Hello,
I have a CSV that I need to delete a line just below the Header (the second row of the csv) using a bat file. However, I have no idea how to do this.
Does anyone have an idea how this can be done?
Thank you for your help
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
ECHO.col.heads>file2.csv
MORE +3 file1.csv>>file2.csv
might work, IF your csv file is not unicoded, and IF your line-breaks are recognized by MORE. If your app REALLY has to have column heads, you can just echo them to the file before the MORE statement. You should take a look at your csv file to see if it’s Unicode, and what line-breaks it uses. I recommend EDIT /70 to examine the file because it shows Unicode interstices as well as line-break char.s
Another way is to use either FIND or FINDSTR with line numbers and then exclude those line numbers from your output. f/e: FIND /N /V “” file.csv|FIND /V “[3]”
would exclude line 3 from output. If “[3]” occurs in the base-file stream, then use : FIND /N /V “” file.csv|FINDSTR “^\[3\]”
which will limit [3] to the beginning of the line and not mid-stream.
message edited by nbrane