02-12-2013 08:11 AM
In C# in order to edit a line in a file i have to do as following:
1. Read content in a string array.
2. Find a line in the array I want to edit.
3. Edit the line.
4. Write updated string array into the file.
I wonder if I have to do the same in LabView?
Solved! Go to Solution.
02-12-2013 08:17 AM
Hi,
with Labview, you can write a part of a file by using cursors.
Have a nice day,
02-12-2013 08:33 AM
Try this example: https://decibel.ni.com/content/docs/DOC-25163
02-12-2013 08:35 AM
Hi ramses64,
Can you be more specific about it? What is "cursors" and how we use it?
02-12-2013 08:51 AM
As an aside, in why are you reading the whole file into an array? Why not use file.readline() and file.writeline()?
02-12-2013 09:25 AM - edited 02-12-2013 09:25 AM
As far as i know you can not edit a line in the middle of the file. Have to read the whole file with file.readline() any way.
02-12-2013 12:55 PM
You can edit parts of a file without reading the entire file. However, you can only change the characters in the file; you cannot insert new characters in the middle or delete existing characters without reading and rewriting everything past the point where you are making changes. To go to a specific location in a file, use the Set File Position function in the File IO->Advanced File Functions palette. The next read or write will start at that file position, so to make changes in the middle of a file you need only to move to the right file position and start writing, which will overwrite the existing data from that location.