[Solved] How can I convert an excel file into CSV with batch skipping some rows?


A very easy way, is to create a vbs script. Paste the below into a notepad and save as XlsToCsv.vbs. Make sure you give the full path of sourcexlsFile and also destinationcsvfile

To use: XlsToCsv.vbs [sourcexlsFile].xls [destinationcsvfile].csv

 if WScript.Arguments.Count < 2 Then
    WScript.Echo "Error! Please specify the source path and the destination. Usage: XlsToCsv SourcePath.xls Destination.csv"
    Wscript.Quit
End If
Dim oExcel
Set oExcel = CreateObject("Excel.Application")
Dim oBook
Set oBook = oExcel.Workbooks.Open(Wscript.Arguments.Item(0))
oBook.Sheets(1).Range("1:5").EntireRow.Delete  'this removes the first five rows everytime
oBook.SaveAs WScript.Arguments.Item(1), 6
oBook.Close False
oExcel.Quit
WScript.Echo "Done"

3

solved How can I convert an excel file into CSV with batch skipping some rows?