Save csv file to existing file but in new sheet and rename sheet

938 Views Asked by At

I am running a process where it downloads multiple csv file as my reports In my downloads folder where by default it takes name with a time-stamp. Example - "Keyword Planner 2014-11-24 at 21_29_24.csv"

Then i rename this file say flipcart.csv, amazon.csv, and so on.

Now, when I run the process next time It will again download the file with time-stamp and while renaming I need to :

1.Check if file name already exists then write the data to existing file but in new sheet.

2.Rename that sheet with month & year.

How can this be achieved?

Thanks In Advance

2

There are 2 best solutions below

0
On BEST ANSWER

You can call a php script from a batch file which will do a simple operation (create or update) and in create it will copy the data from a csv file to an excel sheet and in update you can create n number of worksheets.

0
On

CSV is a simple text based format. It has no concept of "sheets", so this is not possible.