Newbies cubestar Posted March 7 Newbies Posted March 7 Howdy! I am using "Write to data file" in FM19 to add a row of titles to an existing csv file and am running into an issue where part of the first row of data is being removed. I have tried toggling the UTF setting and the append option on and off to no avail. Most examples that I find for Write to data file seem to be for creating files, not adding to them. Thanks in advance for any insight!
comment Posted March 7 Posted March 7 When you write to a data file, you always overwrite, not insert. To add a title row, you need to read from the data file into a variable, add the title row and write the result back to the data file. See the demo here: https://fmforums.com/topic/109501-exporting-a-custom-header-to-excel-from-filemaker-with-a-special-character-like-£/?do=findComment&comment=490073
Newbies cubestar Posted March 7 Author Newbies Posted March 7 Thanks for the info. The problem is that some of our files are hundreds of mb in size, so reading them into a variable is not feasible. Looks like I may need to look into the XSLT method, or just rig the server to do a simple shell script to do it. Thanks again!
comment Posted March 8 Posted March 8 There is yet another method you could explore: https://fmforums.com/topic/106980-can-i-write-data-to-a-textfile-using-fmpro-16/?do=findComment&comment=483109
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now