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
removing first line (titles) of a .csv file
Moderators: JRL, Dorian (MJT support)
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
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
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