08-13-2008 09:35 AM
Hi,
I tooks data from hardware and saved it as a series of small files so I would not be stuck with huge files. Now I want to put together some of these files. I have the files as data_001.lvm, data_002.lvm, data_003.lvm etc. I have tried using the merge files option but it put the data side by side. I want this data to be output in the same columns so that I have a column with all the time data and a column with all the sampled amplitudes.
I have attached 2 exapmles of the data files. I am using Labview 7.0.
Thanks, Magreen
08-13-2008 09:40 AM
Hi Magreen,
read your files and merge it with one of the others. Use the file IO vis
Mike
08-13-2008 09:46 AM - edited 08-13-2008 09:47 AM
Hi This is one method for doing it with text files.
To expand on this concept you could put the operation in a for loop with an array of filenames as the IP. and a shift register to keep appending each file.
Craig
08-13-2008 10:29 AM
Thanks for replying.
I can't seem to find the component just after path,
(The yellow one with a picture of glasses:)
what is this component? is it in Labview 7?
08-13-2008 10:34 AM
08-13-2008 01:30 PM
Hi Magreen,
you can also use the "Seek" function. If you use it you only need to read one file. Open the other file, move the "cursor" to the end of file position and write the read data to this file. If you do you don´t need to read all data into memory.
Hope it helps.
Mike
08-15-2008 11:09 AM
I managed to combine the files using the attached files.
Now I need help using a loop to combine a large number of files.
In this example I combine only 3 files. In reality, I would need
to do this for maye 100 files.
08-15-2008 12:26 PM - edited 08-15-2008 12:27 PM
May file tools have changed, but you definitely don't want to read it as numerics, sice your files are already formatted.
Read your files as a plain text string in a loop and append the string to a new file until you run out of files. Here's a quick draft that you need to adapt to LabVIEW 7.0.
08-15-2008 12:48 PM
Thanks,
Is it possible that you email this as a vi. file.
I cannot locate some of the tools you have used.
08-15-2008 12:59 PM - edited 08-15-2008 01:00 PM
As I said, the file IO has changed quite a bit since LabVIEW 7.0. Since my VI is in LabVIEW 8.5, you won't be able to open it.
Still you should be able to create it from scratch.
(You could also use "list files" with e.g. "data_*.txt" as pattern and simply autoindex over the file names in a FOR loop.)
See how far you get. If you think you are close, attach your work and we find out what else is needed. 😉