LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems setting file position

Hi,

 

Thanks to everyone who has helped me so far. Its very much appreciated.

 

I have a problem setting file position.

 

What i'm doing is performing a test and saving rows of data to a database (lvm). Those results some times fail and they are marked as such.

 

I can then search my data and reload the data (as a full row) at a later date (after reworking product) and retest the failed section.

 

I want to resave the data (as a full row with ammended results) over the top of the old. The data array is the same dimension as earlier, just replacing FAIL with an actual pass result.

 

Thing is when i hit save, it either saves it to the end of the file or the beginning of the file. I can understand this as that is how i have file position set, but when i set it to current it save it at the top but second column in.

 

I am trying to set the position of where it saves as the same index point as where it found the data in the first place.

 

Can someone tell me what i'm doing wrong?

 

Here is a sample set of data.

0 Kudos
Message 1 of 5
(2,595 Views)

You can do that in another way. I see the file is small in size only so read the whole file keep it in momory read the data you want to change , change it and then write the whole data again into the same file.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 5
(2,591 Views)

Hi,

 

i did think of doing it this way, but the file obviously grows in size as we do tests. I don't want to have unmanagable arrays going backwards and forward into the program.

 

I assumed i could just over write the data, which i can actually do....just not in the right place it seems.

 

Its the figuring out of the position i am struggling with.

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

Hello,

 

The way you currently have the application set up I think the only way to do this would be as was suggested above. Currently are you only using the Write to Spreadsheet VI to write the data? I think if you were to use the Report Generation Toolkit and write to Excel then you find it a lot easier to edit data within the spreadsheet, is this a possibility?

 

Kind Regards

David B
Applications Engineer
National Instruments UK
0 Kudos
Message 4 of 5
(2,566 Views)

Hi

 

i am worknig on this in another way and started an alternative thread as its technically a seperate subject.

 

This thread here....but again, not working correctly and i'm struggling to sort this.

 

http://forums.ni.com/t5/LabVIEW/String-format/m-p/1971113

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