Brian Dunning's FileMaker Custom Functions

CSV_readField ( string ; value )

get's the N-th value in a csv

  Average rating: 4.8 (20 votes) Log in to vote

Bert Kraan   Bert Kraan
Allied Pea's
http://buffel.org

Share on Facebook Share on Twitter

  Sample input:
Example CSV: "Header";"";"2015";"";"";"Chess";"";"";"no";....

If [ CSV_readField ( imported::string ; 1 ) = "Header" ]
Go to Record ....

or

Set Variable [ $Game ; Value:CSV_readField ( imported::string ; 6 )]
  Sample output:


true




$Game gets set to "Chess"

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

We get a csv from another system which needs to be "read"/interpreted and imported into filemaker. Importing is easy using filemaker's "Import Records" script step. After that :

The function enables me to read fields of which I know they contain information so I can put the values in filemaker.

I know which (N-th) field contains the information per the csv definition.

 

Comments

unix   unix, Japan
Jan 4, 2016
I wonder why do you say the "semi-colon separated value" as CSV.
 
Bert Kraan   Bert Kraan, Apeldoorn
Jan 5, 2016
In Europe we use the comma as a decimal separator, and it is custom to separate CSV's using a semicolon.

Otherwise differentiating between which comma is a decimal separator and wich is a field separator would be a real challenge.

(http://www.digitalpreservation.gov/formats/fdd/fdd000323.shtml)
 
unix   unix, Japan
Jan 6, 2016
Thanks!
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. 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 20 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: