LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i remove header from a txt file

Solved!
Go to solution

Hello. I have an aquisition file and this remove_headers.vi does not remove all my header. I m attaching the file, the remove_header.vi and the file after removeing header.

Pls help.

Thanks a lot... 

Download All
0 Kudos
Message 1 of 8
(5,637 Views)

Your Remove Headers.vi isn't trying to remove any headers, it is just reading the text file using the Read From Spreadsheet file and then writing it back out again.

 

Do you know how many lines make up the header?  You need to use a Delete from Array to delete that many rows from the 2-D array before you write it out again.

Message 2 of 8
(5,626 Views)

this is the header should be separeted from data, it has 6 lines.  

I have 100 data file, i need to make arithmetic media from 5 to 5 files. but firstly, i need to remove the headers for all files. 

Headers looks like that: first 6 lines:

i1151217.005186
Iasi 12/05/2011 16:55:51 12/05/2011 17:00:51 0000 0027.6 0047.2 00
0000000 0030 0009001 0010 02
1 0 2 12000 1 0850 3.75 00532.o 0 0 00 000 12 009001 0.500 BT0
1 1 2 12000 1 0900 3.75 00607.o 0 0 00 000 00 009001 3.1746 BC0
532.000 .o analog 0 607.000 .o photon 0
6.1384 0.0000
6.1357 0.0000
6.3582 0.0000
6.1585 0.0000
5.9201 0.0000
6.2191 0.0000
5.8647 0.0000
6.1679 0.0000
6.1651 0.0000
6.1189 0.0000
6.1023 0.0000
6.3326 0.0000
7.2150 0.0000
7.3457 0.0000
 

 

0 Kudos
Message 3 of 8
(5,621 Views)

Here you go. You should read as string to get the whole header, then delete the first six rows of the array(as previously mentioned). Finally write it back to a new file.

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
Message 4 of 8
(5,608 Views)

Thanks a lot, it really helps me! 

0 Kudos
Message 5 of 8
(5,596 Views)

Even Deejay, it works, but how do i do it for multi files? i have to select one by one, i need for a files from a folder, i -ve tryed a little but i-ve got some problems so i-ve stuck..

0 Kudos
Message 6 of 8
(5,593 Views)
Solution
Accepted by topic author florin.unga

Hi,

 

For reading multiple txt files you can use a List Folder Function from file I/O palette. Refer the vi attached.

Regards,


Nitzz

(Give Kudos to good Answers, Mark it as a solution if your problem is Solved;)) 

Message 7 of 8
(5,590 Views)

Thanks a lot Nitzz 

0 Kudos
Message 8 of 8
(5,583 Views)