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.

Extracting text

Featured Replies

  • Newbies

Hi,

I get orders from a well known online retailer by email notification. I can cut and paste the full details into a text field in FMP 11, but how do I search this field to extract and order number or a Stock Keeping Unit (SKU) number?

I want a script to read the field, find the text "Ord No.xxxxx" and then place it into my dedicated order number field in the table.

So searching the field would find: Ord no.123456

Then place 123456 into an order number field.

Thanks in advance

Chinablue

This need comes up from time. There are pleanty past post about how this can be approached. Read about Left, LeftWords, Right, Rightwords, MiddleWords, etc. Functions, do a search for keywords in this Forum, using Parse, Parsing Text, Extract, Extracting, such as +parse +Text or +Extract +text. This search engine is the Gear Icon next to the quick find, under your icon.

You could also run this through a text editor using Grep Patters of Regular Expression.

Post a clone of your file, an actual example of the text or site, so we can see what you are talking about.

Lee

  • Author
  • Newbies

This need comes up from time. There are pleanty past post about how this can be approached. Read about Left, LeftWords, Right, Rightwords, MiddleWords, etc. Functions, do a search for keywords in this Forum, using Parse, Parsing Text, Extract, Extracting, such as +parse +Text or +Extract +text. This search engine is the Gear Icon next to the quick find, under your icon.

You could also run this through a text editor using Grep Patters of Regular Expression.

Post a clone of your file, an actual example of the text or site, so we can see what you are talking about.

Lee

  • Author
  • Newbies

Thanks Lee,

I have managed to extract the order number from the text field.

Feels like a bit of a hack, but it works if the line always starts with the same characters, eg "Order No."

How does FM recognise a carriage return at the end of a line of text. I have had to use a blank space

at the end of the data.

Is there any way to move from line to line extracting the data?

I Would like to extract a "name", "address", "County/State", "zip" etc.

I've tried to attached a copy of a file but the upload is not permitted.

Below is the sample text and the calculation that does the extraction.

Dispatch to:

MR J STEED

BROADMOSS

BRUCEFIELD RD.

PERTHSHIRE

PH11 6LB

United Kingdom

Order ID: 202-9739057-1767548

Thank you for buying from Milly's Menu Shop

Calc

Let ( [

start = Position ( simple::contents ; "Order ID: " ; 1 ; 1 ) + Length ( "Order ID: " ) ;

end = Position ( simple::contents ; " " ; start ; 1 )

] ;

Middle ( simple::contents ; start ; end - start )

)

Any help extracting data line by line would be a great help,

Thanks

Chinablue

I Would like to extract a "name", "address", "County/State", "zip"

If these elements are always present and in the same order, you can use the GetValue() function to extract them.

How does FM recognise a carriage return at the end of a line of text.

Use the ¶ operator.

  • Author
  • Newbies

Thanks for your help.

Does what I need.

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.