Hello All;
I have an application which needs to read and write to/from text files. The Config VIs do not give me what I need, and so I am using the File I/O (Open File, Close File, Read Text File, Write Text File) and Adv File Functions (Set File Position). My general flow is this:
Open File --> Read from Text File (Use Spreadsheet String to Array to itemise everything) --> Manipulate the String Array --> Set File Position = 0 from Start --> Write to Text File --> Close File
Having said that, if my reworked string array is shorter (i.e. smaller index) than my original, when I write to file, not everything is replaced. Basically, it only replaces the exact number of characters, if you will, that it needs to. See attached text example (in this case, the !end is listed twice...)...
Is there a way to set the End of File (eof) such that the file ends immediately after I write information? Is there a way to "empty" the file immediately before writing? I suppose an alternative would be to write to a temporary file, and replace the original file with the (slightly smaller) temporary file, but I'd rather only use the single file (if possible).
Anyway, any help would be appreciated!
Thanks in advance,
D. J. Hanna