September 29, 200421 yr Does anyone know a way of making filemaker export a CSV file with windows file endings (CRLF)? Surely there must be a way of doing this!
November 16, 200421 yr Author several weeks later and I'm still no closer to finding a solution. Just for some further info, I'm working on Mac OS X and trying to get it to export as a csv file with CRLF line endings. At the moment I'm having to export a file out as a csv, take it into a code editor, change the line endings and then resave the file. I'm then emailling the file to someone who i beleive is importing the exported file into an access database. If anyone can think of a better way of doing this, I'd appreciate your advice!
November 16, 200421 yr This will do it with AppleScript. It can also be done with an XSL stylesheet. I don't know exactly what output you want for the Vertical Tabs (if any). The following will convert them into period space ". " [Much of the code is to make sure that AppleScript's text item delimiters don't get left set to other than their default, which is "".] gText.csv is on the Desktop. Copy/paste below into Script Editor and/or into FileMaker Perform AppleScript step: set outputFile to (((path to desktop) as text) & "gText.csv") as file specification global newtext tell application "Finder" -- needed inside FileMaker set theText to read outputFile set myText to my replaceEnding(theText) set finalText to my replaceVT(myText) open for access outputFile with write permission try set eof of outputFile to 0 write finalText to outputFile starting at eof close access outputFile on error errMsg number errNum try close access outputFile end try set returnString to errMsg & return & "Error Number: " & errNum display dialog returnString giving up after 10 end try end tell on replaceEnding(someText) try set AppleScript's text item delimiters to {ASCII character 13} set textList to text items of someText set AppleScript's text item delimiters to {(ASCII character 13) & (ASCII character 10)} set newtext to (textList as text) on error errMess number errNum set AppleScript's text item delimiters to "" set newtext to someText end try set AppleScript's text item delimiters to "" return newtext end replaceEnding on replaceVT(someText) try set AppleScript's text item delimiters to {ASCII character 11} set textList to text items of someText set AppleScript's text item delimiters to {". "} -- change the Vertical Tab to period space set newtext to (textList as text) on error errMess number errNum set AppleScript's text item delimiters to "" set newtext to someText end try set AppleScript's text item delimiters to "" return newtext end replaceVT
Create an account or sign in to comment