07-20-2017 06:42 AM
Hi,
how i can replace a first line (txt file tabulaton for example) with another,
example:
Test.txt ( tabulation)
AsZ Baz eC Deaz Eazd 4 5 4 2 1 12 41 41 1 2
to
A B C D E 4 5 4 2 1 12 41 41 1 2
And write that in the file ,
Thank you ,
Solved! Go to Solution.
07-20-2017 07:01 AM
You basically need to copy the file. One way to proceed is as follows:
As far as I know, there is no way to directly write within a file (as there's no way to "shift" the characters to the right of the insertion point as characters are added or deleted).
Bob Schor
07-20-2017 07:04 AM
There is no other simple method, or a direct labview function?
07-20-2017 07:09 AM
Thank you Bob_Schor,
I will try it ,
07-20-2017 07:31 AM
Imaduino,
Read the last paragraph in my reply -- it explains the difficulty in moving bits around that are stored on media like a disk drive (think about adding or subtracting a few bytes at the beginning of a 1 MB file).
Bob Schor
07-20-2017 07:36 AM - edited 07-20-2017 07:38 AM
Hi,
you might overwrite the "first line" - as long as you use the exactly same number of chars as the original line!
(Text files are just an array of bytes…)
When your new "first line" is shorter you need to fill up with spaces. If it's longer then you need to use Bob's copy method…