LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to cut big text file into several small text files?

Solved!
Go to solution

Hi amswak,

 

splitting TDMS files may be a little bit more trickier - as I wrote before: by splitting you may destroy some needed data structures...

Best regards,
GerdW


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

I just stripped this version into a simpe verison.

 

 

0 Kudos
Message 22 of 27
(1,977 Views)

Hello all, 

I have large file (>2GB). I don’t want to spilt the file into small text files, But I want to read the complete text file in LV.

Because, If I’m splitting the file into small files then I’m not getting proper data( e.g. at 98th  row  my data is “.005903 1  498             Rx   d 8  16 100   0 156   0  30   2 139” so in 1st file my data is storing up to “.005903 1  498             Rx   d 8  16 100 “ and remaining data “0  156   0  30   2 139” in other file).

 

Please tell me any possible ideas.

 

Thank you in advance,

Guru

Munna
0 Kudos
Message 23 of 27
(1,825 Views)

It appears that you are reading blocks which may not always end at the end of a row.  If the rows end with a carriage return or linefeed character, just check the end of the block you read for that character. If the last character is not the end of line character, go back until you find the end of line. Save any characters after the end of line and prepend them to the next block when you read it.

 

Lynn

0 Kudos
Message 24 of 27
(1,812 Views)

You say rows.  Do you mean actual lines in a raw text file?  If so, just read by line.  You can right-click on the Read Text File and choose an option to read lines instead of characters.  Read X lines and write them to a text file.  Repeat until you get an End of File error.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 25 of 27
(1,806 Views)

Hai all,

 

Thank you so much for your replies.

 

Yes, your right .. But i dont want to split the raw file... i want to read the total raw file into line by line.

 

please let me know any other solution.

 

Thanks & Regards,

Guru

 

Munna
0 Kudos
Message 26 of 27
(1,791 Views)

Munna232 wrote:i want to read the total raw file into line by line.

Then as I already suggested, use the Read Text File with the read lines option.  You specifiy how many lines you want to read (even if it is just one).  You can do with the data whatever you want.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 27 of 27
(1,782 Views)