LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need a fast simple file sort VI

I have an application with data coming in via email.  The data is being stored in a simple text file with the date/time and the reading separated by a tab.  When a new sample comes in a line is appended to the data file.  Due to the way the data comes in the file can get samples that are not in the proper date/time order.  I currently make a call to the command prompt and run the native windows sort file application on the file when each sample comes in.  This is causing problems when the parallel functions are generating excel spreadsheet report.  The command prompt call seems to distrupt the active x calls to excell.

Is there a simple file sort subvi available that would keep it all in the labview engine, or is the only way to read the file into an array, sort and then write back out to the file?

thanks
0 Kudos
Message 1 of 2
(2,485 Views)

Hi,

Starting with your last sentence. I don't think there is any other way (in LV or whatever) Read the file, sort the data, write the sorted data to a new file and finally delete the old unsorted file (or rename it)

Besides that I don't see why a DOS box should interferes with the ActiveX interface except when Excel and your sort solution use the same file at the same time.But it would be nice to do it all in LV.

Just read the file, sort it and write it back. If you need any help with that I am glad to help.

 

0 Kudos
Message 2 of 2
(2,474 Views)