Delete First Row & Column in multiple CSV

  • Hello All, I have multiple CSV files saved in a folder and need a script that will open all the csv files, delete the first row and first column, save back leaving the file format unchanged.


    thanks

  • Re: Delete First Row & Column in multiple CSV


    because i need to upload the csv file and do not need the first row and first column. so i need to delete the first row and column and the remaining cells adjusted to fill the deleted space.

  • Re: Delete First Row & Column in multiple CSV


    You could try this method - this code will allow you to browse to the folder with CSV files - it will then iterate through all the csv files and remove row 1 and column 1. BEFORE running this code BACKUP all the files - this code will alter the csv files so make sure you have a BACKUP. I cannot emphasise this enough.


    See attached workbook.
    Option 2 - You could open the CSV for binary access and then manipulate the resultant array - this is more complicated - sample code:


    However option 1 I think would be easier

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!