manipulating multiple csv files.

avishain

Board Regular
Joined
Dec 14, 2010
Messages
75
Hello all,

i recieve every month about 20-25 csv files which located in the same folder (say under c:\my files)

these files are are completly structered the same (columns a to t),however,the length of each file may vary ( 1 file can contain 100 rows and the other 2000 rows).

the name of each file is always in this structure :

standart_201103_0001_00000064_00001111_03241234.CSV

another 1:

standart_201103_0001_00000064_00003232_03241554.CSV

in each csv file there is only 1 worksheet.

what i need is the following:

1.i want that each CSV will change its worksheet name to the number which appears in the 35 char from the left of its name.

for instance:

standart_201103_0001_00000064_00001111_03241234.CSV

so the worksheet name would be 1111

standart_201103_0001_00000064_00003232_03241554.CSV

so the worksheet name wouuld be 3232

2.then,i want that all worksheets (within each csv file) will be copied to 1 main file (XLSX file) .

3.then,when i have this main workbook i want to open a new worksheet (inside this main workbook) and i want all the data from all worksheets ("1111","3232" and so on..) will be copied to this worksheet,so eventually ill have 1 table consist all of the data that i had and these csv files. ( i remind you again,all the csv files have the same structure,coulmns A to T)

thank you very much!1
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,224,558
Messages
6,179,512
Members
452,920
Latest member
jaspers

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top