From CSV to Excel

hello, I need help on how to save cvs as excel.
I download file from web and it is automatically saves as .cvs. how do I then convert it to .xlsx and then delete first 5 rows?

@markosc
give a try on:

  • read in csv with read csv activity into a datatable
  • write resulting datatable to Excel with the write range activity

for ommiting the first 5 rows following can be done:

  • dtShortened = dtOrig.AsEnumerable.Skip(5).CopyToDataTable
1 Like

it gives me this error: Read CSV: The CSV file format for (the cvs file path) is invalid. Line 7 contains more values than the header line.

it could be a hint that the structure of csv is not consistent. Feel free to share with us the first 8 lines from csv

Cant because it has data that i cant show

then check the structure of the first 8 lines by yourself. Is it consistent or does the number of columns are different compared to the 8 lines?

Hello @markosc ,

You could use Move/Copy activity to rename file, please provide .xlsx extension to dest property of these at last.

Cheers,
Pankaj

ok so in first 5 rows I have text which is written in first column “A” which have to be deleted. Then I have “headers” (more than 10) and then data.

this feedback let us be unclear on if the number of cols are now always the same within the diffeent rows or not. Please check and share the result with us. E.g. try again read csv along with the modified data

yes, it is “table” with data