Brian Dunning's FileMaker Custom Functions

ExtractLine ( TextField ; LineNumber )

Return a specific line out of a text field.

  Average rating: 4.5 (39 votes) Log in to vote

Michael Haymore   Michael Haymore

Share on Facebook Share on Twitter

  Sample input:
ExtractLine ( "Red
Black" ; 3 )
  Sample output:

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This is an easy way to pull a specific line of text out of a field that has it's data seperated by carriage returns. If you try to get a get a line of text that is not available, it will return a "?".



Chris Lord-Paquin   Chris Lord-Paquin, Manchester, NH
May 4, 2009
The above custom function works great, but does not pull the last value of the field. There must be a "¶" after the last value for the function to fully work. The following works properly.

Let ([
TextSource = TextField & "¶";
TextLine = Middle (TextSource; Position ( TextSource; "¶"; 1; LineNumber - 1) + 1;
Position ( TextSource; "¶"; 1; LineNumber) - Position ( TextSource; "¶"; 1; LineNumber - 1) - 1

If ( IsEmpty (TextLine); "?"; TextLine)
Jo   Jo, brussels
Sep 25, 2015
wouldn't getvalue do the same ?

Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 16 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: