Skip 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.

Parse text field into separate records

Featured Replies

I have a text field that contains an essay. I need to parse each of the essay's paragraphs into separate records in a different table. The paragraphs are delimited by double line feeds. If I copy the essay into BBEdit, I can identify and select each of the paragraphs by running the expression \r\r.+    But I have no idea how to accomplish something similar in FileMaker. Can someone help? Thanks.

you could use 

GetValue ( listOfValues ; valueNumber )

if your paragraphs are double returned — ¶¶

Then increment by two : 

GetValue ( txt ; 1 )

GetValue ( txt ; 3 )

GetValue ( txt ; 5 )

Edited by rivet

1 hour ago, rivet said:

if your paragraphs are double returned — ¶¶

Then increment by two : 

GetValue ( txt ; 1 )

GetValue ( txt ; 3 )

That would work only if a paragraph will never contain a single carriage return.
 

I would suggest something like (pseudocode, untested):

Set Variable [ $parentID ; Parent::ParentID ]  
Set Variable [ $paras ; Substitute ( Parent::Textfield ; [ "¶¶" ; Char ( 31 ) ] ; [ ¶ ; Char ( 30 ) ] ; [ Char ( 31 ) ; ¶ ] ) ]
Go to Layout [ Child ]
Loop
  Set Variable [ $i ; $i + 1 ]
  Exit Loop If [ $i > ValueCount ( $paras ) ]
  New Record
  Set Field [ Child::ParentID ; $parentID ]
  Set Field [ Child::Textfield ; Substitute ( GetValue ( $paras ; $i ) ; Char ( 30 ) ; ¶ ) ]
End Loop
Go to Layout [ original layout ]

 

  • Author

Perfect! Your untested pseudocode worked perfectly on first pass, with no debugging (which is something that rarely happens with my code). That's exactly what I needed.

Thanks very much to both of you.

 

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.