Merge Files contain Field Names and end in .mer
This post talks about exporting with "Friendly Field Names"
I have created a "First Record" with the Field Names I want for export, it is a pain.
Thank you. I think I will try out
Just did another search on the net and came across Anvil Dataworks' blog at http://www.anvildataworks.com/?p=151/. They have added this veryuesful and simple technique which I have just tested and it works perfectly. So thank you to him and you for the help...
"CSV files are by far one of the most common types of delimited text files and thus a popular option for exporting data. The frustrating thing about doing CSV exports from FileMaker is that there is not an option to include field headers, but there is an easy solution. Merge (.MER) files are CSV files with file headers and a different file extension.
If you are doing a quick export, you can simply rename the file after your export is complete. If you are scripting your export and specifying the path you can tell it to use a CSV extension by using a script variable. For instance if you wanted to export data.csv to the desktop with headers your variable declaration would be:
“file:” & Get (DesktopPath) & “data.csv”
this for the first two lines of a csv file
If[Get ( SystemPlatform ) = 1]
Set Variable[$MacOs; Value:True]
Set Variable[$EndOfLine; Value:Char ( 13 ) & Char ( 10]
Set Variable[$MacOs; Value:False]
Set Variable[$EndOfLine; Value:Char ( 10 )]
Set Variable[$output; Value: “field1;field2;field3”& $EndOfLine] // first csv line
Set Variable[$err; Value:BE_WriteTextToFile ( $file; $Output ; False )] // write of the first csv line
Set Variable[$output; Value: Table::Field1 & ”;” & Table::Field2 & ”;” & Table::Field3 & [$EndOfLine] // second csv line
Set Variable[$err; Value:BE_WriteTextToFile ( $file; $Output ; True ) ]// write of the second csv line
and so on...
$file has to be set with the correct file path (Mac or Windows)
Will's merge comment was just the trick.
I used to make a record that had the field names in it which was very difficult to use during "finds" followed by exports.
New Trick I found following Wills Recomendation of the MER type export (.mer)
Export a CSV file quickly with the fields you want. This will set the file name you need into your folder.
Then, reexport the file. Choose the file name you just created (with your mouse).
Then finally, change the format to Merge Format. This will keep the CSV name but give you a CSV with the field names in it.
Thank you Will! I discovered the rest of this a bit by happen-chance.