# .bat Batch file to delete first row of data



## jfarc (Dec 22, 2008)

Before I get an input file into Excel for further execution, I need to have a *.bat command file do 2 simple things:

1) Append 1 existing .csv file to another existing .csv file - I have this command line in the *.bat as 'TYPE FILE1.CSV>>FILE2.CSV' and it works fine.

But,

2) I first need to edit the 'FILE1.CSV' and delete the first row of data(the column headings) before I Append the 2 files.

Does anyone know the *.Bat file command line to do this?

This user does not have access to Excel, but they are the only one that has access to the original data files.  Otherwise, I'd do this easy Append in Excel, but can't.


----------



## Macropod (Dec 22, 2008)

Hi jfarc,

Is there a reason you can't delete the unwanted row once the file's been imported into Excel? If you use a macro attached to a toolbar button, the macro could automate the deleteion - or even ignore the 1st row of the csv file.

Cheers


----------



## jfarc (Dec 23, 2008)

Yes, I need to do this before it gets to a user with Excel.

The user with access to the raw data files does not have Excel and they also need to do further execution with the end result file as do the Excel users down the chain.  I can't have a time delay by sending the files to the Excel users then back again to the first user.

In short, I need the row deletion done by a *.bat file command outside of Excel.


----------



## xenou (Dec 23, 2008)

I found a lot of hits at google typing _dos delete first line_

Such as:
http://www.computing.net/answers/programming/delete-first-line-of-text/13940.html


----------

