From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

extracting particular number of columns from a text file and writing in another

Hi

 

I want to extract  few coulmns from a text file and write it as it is in another text file. I added "space" as delimiter. The vi I created is working on smple text file with equal number of spaces and digits in a column. But the problem which i am facing is due to unequal number of spaces between two columns.

 

I thought of copying my data in excel and then extract required columns from there but I am not getting how to do that and will it work or not.

 

I am attaching the vi of my work so far and the text file also. 

 

Thanks in advance..

rchkrishna

Download All
0 Kudos
Message 1 of 3
(2,571 Views)
Simple solution: replace all occurances of duplicate space chars by a single space. After you have done so you convert your string to an array...

(It's a bad idea to use a variable amount of delimiters between values in a delimiter-based text file format anyway!)
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(2,544 Views)

I tried that also but it is making the data very clumsy and still columns are not correctly separable.

0 Kudos
Message 3 of 3
(2,538 Views)