04-14-2014 11:59 AM
Hello
Does any one know how to overwrite specific values in a .txt file?
here's and example of what i need:
I just want to replace the numbers 1 and 2 every time I run my code, the rest remain the same.
this is the part of the code Im using
thanks!
04-14-2014 12:30 PM
The easiest way would be to read the file into an array, change the values and then write the complete file.
04-15-2014 09:12 AM
Hello Tokighy,
What Bryan mentions is a good approach, you can also check the Write to Text File and Read from Text File.vi in the Find Examples section in LabVIEW, you can take the output from the Read from Text File (having as input your .txt file) and then use either Replace Substring or Search and Replace String functions from the String palette.
http://zone.ni.com/reference/en-XX/help/371361H-01/glang/search_and_replace_string/
http://zone.ni.com/reference/en-XX/help/371361J-01/glang/replace_substring/
Hope you find this information useful!
Regards,