removing first line (titles) of a .csv file

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
csb72
Newbie
Posts: 17
Joined: Thu Sep 20, 2007 6:21 am

removing first line (titles) of a .csv file

Post by csb72 » Sun Sep 23, 2007 6:58 pm

I search through the forum and help areas and could not find any subjects or postings related to this. So ...

Does anyone know how to remove just the first line (titles) of a .csv file?

Thanks,
Carl

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sun Sep 23, 2007 7:50 pm

Here's one very simple solution, read the file starting at line 2 and write it to another file:

Let>lnum=2
IfFileExists>c:\test\test.csv,step1,finish
Label>step1
IfFileExists>c:\test\test2.csv,step2,start
Label>step2
DeleteFile>c:\test\test2.csv
Label>start
ReadLn>c:\test\test.csv,lnum,line
If>line=##EOF##,finish
WriteLn>c:\test\test2.csv,res,line
Let>lnum=lnum+1
GoTo>start
Label>finish

csb72
Newbie
Posts: 17
Joined: Thu Sep 20, 2007 6:21 am

Post by csb72 » Mon Sep 24, 2007 3:10 pm

thank you!

that worked perfectly after I made a few modifications.

till next time ...
have a fantastic day!
Carl

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts