LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying a particular line (content) of data in a file.

Hi All,
 
I've a requirement with file modifications, but i'm new to Labview so couldnt correctly fix it...
My req is something like this.....
 
I've a file named mytemplate1.txt which is added to this post....
In that i've a line, i.e no. in attacehd is 153
"modelLanguageCode=ENU"
 
In that i wanna put a control to the bolded one above.
So whenever i modify that control to SPA, GER, JPJ .....
It should update the content respectively.
 
I tried with different file functions available in Labview 8.2 but unable to find the solution ...
 
So my temporary approach for this is
Concatenate string
where
Part 1 is data above modelLanguageCode=
part 2 ENU
part 3 data after "modelLanguageCode=ENU"
 
But this doesnt looks ideal for my req.
 
So please suggest any good solution....
 
-Suneel.
Download All
0 Kudos
Message 1 of 5
(2,634 Views)

Have a look at the attached example.

Craig



Message Edited by craigc on 07-15-2008 03:50 AM

Message Edited by craigc on 07-15-2008 03:51 AM
LabVIEW 2012
Download All
0 Kudos
Message 2 of 5
(2,628 Views)

Hi Craig,

Thnaks for ur help....

But its is again appending the mytemplate1.txt

anyways i will try to write it to a new file....

 

-Suneel

 

 

0 Kudos
Message 3 of 5
(2,608 Views)

Yep my fault,

 

In between the file read and the file write operations.  set the file position back to 0 using "set file position.vi" under the advanced sub pallette within the file pallette.  I have verified this works correctly.

Craig

LabVIEW 2012
Message 4 of 5
(2,600 Views)

Vow Craig,

That's really helpfull thanks....

Thanks again....

-Suneel

0 Kudos
Message 5 of 5
(2,589 Views)