Combine CSV Files
Posted: 30 Jul 2019 20:37
Hello dear people,
I need to combine .csv files but remain the original name. I'll explain
I have various .csv files with the following names
01-15 Codes.csv
01-85 Codes.csv
01-30 Codes.csv
I made a search and I can achive it easly using the following code in a Batch File
But I need something more complex. Because I need the code respect the name of the combined files.
For example, If I use the code
For the files above in the example, all the file will combine in one file called "01.csv" bis this name is because I edited it in the code. I need a code that rename the combined file based on the group of files.
For exmaple, I have the following files:
02-15 Codes.csv
02-85 Codes.csv
02-30 Codes.csv
I need the resulting file is called "02.csv"
Or if I have the following files:
07-15 Codes.csv
07-85 Codes.csv
07-30 Codes.csv
I need the resulting file is called "07.csv"
In other words, I need the the combined file remain the first to characters of on of the initial files.
I cand edit the batch code each time I'll combine the .csv files based on the name of the group of file, but that's not the idea.
I hope you can help me.
Thank you so much!
I need to combine .csv files but remain the original name. I'll explain
I have various .csv files with the following names
01-15 Codes.csv
01-85 Codes.csv
01-30 Codes.csv
I made a search and I can achive it easly using the following code in a Batch File
Code: Select all
@echo off
copy *.csv Combined.csv
For example, If I use the code
Code: Select all
@echo off
copy *.csv 01.csv
For exmaple, I have the following files:
02-15 Codes.csv
02-85 Codes.csv
02-30 Codes.csv
I need the resulting file is called "02.csv"
Or if I have the following files:
07-15 Codes.csv
07-85 Codes.csv
07-30 Codes.csv
I need the resulting file is called "07.csv"
In other words, I need the the combined file remain the first to characters of on of the initial files.
I cand edit the batch code each time I'll combine the .csv files based on the name of the group of file, but that's not the idea.
I hope you can help me.
Thank you so much!