Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hi

 

I have lot of simple comma separated text string than this here:

 

-> Logo_ERNI;SMCStandardkabel;SMCStandardkabel_Z;

-> SO8;SO8_Z;

 

And I would like to convert to this:

 

-> /L/o/Logo_ERNI.jpg;/S/M/SMCStandardkabel.jpg;/S/M/SMCStandardkabel_Z.jpg;

-> /S/O/SO8.jpg;/S/O/SO8_Z.jpg;

 

 

I managed to reach away this point:

 

-> /Logo_ERNI.jpg;/SMCStandardkabel.jpg;/SMCStandardkabel_Z.jpg;

-> /SO8.jpg;/SO8_Z.jpg;

 

I don't know how to continue.

Please let somebody help to solve this problem, if necessary, I send the partial solution.

THX

 

Try this Custom Function:

 

// Customize ( theString ) =

Case ( 
  Right ( theString ; 1 ) ≠ ";" ; 
  "String malformed!" ;
  Let ( [
    pos = Position ( theString ; ";" ; 1 ; 1 ) ; 
    rem = Length ( theString ) - pos ;
    thePart = Left ( theString ; pos - 1 ) ;
    res = Left ( thePart ; 1 ) & "/" & Middle ( thePart ; 2 ; 1 ) & "/" & thePart & ".jpg;"
    ] ;
    res & Case ( rem ; Customize ( Middle ( theString ; pos + 1 ; rem ) ) )
  )
)

Hi baben and welcome to the forums,

 

Hi

 

I have lot of simple comma separated text string than this here:

I don't know how to continue.

Please let somebody help to solve this problem, if necessary, I send the partial solution.

THX

Let’s start by updating your profile to reflect your current version of FileMaker Pro, platform, and operating system. Here is a quick link to get you started My Profile

 

I’m not sure from your sample what to suggest. Why not attach an actual copy of the text.

 

A Custom Function requires FileMaker Pro Advance it will be helpful to see your setup.

 

Lee

What is the purpose of this conversion? It seems you are converting one meaningless (in Filemaker terms) string into another just as meaningless.

 

It seems like you should take this opportunity to separate the semi-colon-delimited values into individual records. Then not only would the calculation of the path become fairly trivial; you would also be able to keep the original names, in case your filing scheme changes one day.

 

 

--

P.S. What does the string:

-> 

represent in your code examples?

  • Author

What is the purpose of this conversion? It seems you are converting one meaningless (in Filemaker terms) string into another just as meaningless.

 

It seems like you should take this opportunity to separate the semi-colon-delimited values into individual records. Then not only would the calculation of the path become fairly trivial; you would also be able to keep the original names, in case your filing scheme changes one day.

 

 

--

P.S. What does the string:

-> 

represent in your code examples?

Our company get every day in a huge database with picture names. But we need exact path of the picture.

Excuse me my weak English knowledge, but this important for me.

 

( etc. in the cell "Shop_cikkadatok::pic" I have some names "Picture01;Picture02;" and I would like convert to "/P/i/Picture01.jpg;/P/i/Picture02.jpg;")

Left (

Substitute
                  (
                   (
                    "/" & Substitute
                     (Shop_cikkadatok::pic ; ";" ;".jpg;" )
                   )
                    ;";";";/"); 
                  Length (
                    Substitute
                       (
                         (
                           Substitute
                              (Shop_cikkadatok::pic ; ";" ;".jpg;" )
                        )
                         ;";";";/"))
)

With this script my partial result now this: "/Picture01.jpg;/Picture02.jpg;"

How to continue?

 

Thanx for all

  • Author

Hi eos, thanx your help.

 

I modified your code

Let ( [
    pos = Position ( Shop_cikkadatok::pic ; ";" ; 1 ; 1) ;
    rem = Length ( Shop_cikkadatok::pic ) - pos ;
    thePart = Left ( Shop_cikkadatok::pic ; pos - 1 ) ;
    res = Left ( thePart ; 1 ) & "/" & Middle ( thePart ; 2 ; 1 ) & "/" & thePart & ".jpg;"
    ] ;
    res & Case ( rem ;  Middle ( Shop_cikkadatok::pic ; pos + 1 ; rem ) )
  )

If the original data example this "Logo_MAXIM;DIP16;DIP16_Z;" the result will this: "L/o/Logo_MAXIM.jpg;DIP16;DIP16_Z;"

This better than my code but I would like to modify second and third part too: "/L/o/Logo_MAXIM.jpg;/D/I/DIP16;/D/I/DIP16_Z;"

I modified your code

 

This doesn't work; you need a recursive function.

 

Use my code to create a Custom Function (CF) named “Customize”, with parameter “string”, then call it as 

Customize ( Shop_cikkadatok::pic )

Actually, you can call the CF whatever you want, but be aware that if you give it another name than “Customize”, you need to change the function call in the code itself (that's the “recursive” part) from “Customize” to the new name.

 

 

PS: If you use Let(), why not do it thoroughly?

Let ( [
    ~s = Shop_cikkadatok::pic ;
    pos = Position ( ~s ; ";" ; 1 ; 1) ;
    rem = Length ( ~s ) - pos ;
    thePart = Left ( ~s ; pos - 1 ) ;
    // etc... 
How to continue?

 

My suggestion was not to continue, but to pick a different route. But that depends on where you want to end up eventually. If you have a use for a semi-colon-delimited list of paths, then maybe you should continue.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.