‎08-09-2010 04:33 PM
Hello all,
I'm trying to delete the first column of my tab delimited text file using LabVIEW and then save it under the same file name. Can someone show me a quick way to perform this operation. Is this even possible with LabVIEW? Any help would be much appreciated.
My purpose is to automate this operation for hundreds of daily text files containing data that needs processing. I'm currently using LabVIEW 8.2.
Thanks!
-noviceLabVIEWuser
‎08-09-2010 04:56 PM
Open it with the Read From Spreadsheet File. This will return a 2D array. Use the Delete From Array to remove whatever column you want. Write the file with the Write to Spreadsheet File.
‎08-09-2010 05:01 PM
If the file is relatively small:
If the file is relatively large then you will likely run into memory issues. In this case you will need to read the file in chunks. You can decide how many lines to read at a time. Use a for-loop that's set to run for the number of chunks to read (based on the total number of lines and the number of lines you want to read at a time). Hint: Quotient & Remainder function. In the loop use the Read Text File VI to read your set number of lines. Convert the lines to a 2D array delete your column, and write out that chunk of data to the new file. Rinse and repeat.
‎08-09-2010 05:38 PM
I'm wondering though, why you need to remove the column. If it's a LabVIEW program that creates it, modify it so the column is not written. If it's a LabVIEW program that will be reading it for analysis, you can ignore/remove it there.