I have aboout 100 .csv files with the same name in different sub directories. I need to copy all the data in these files into a single csv file but since they all have the same name they over write on each other. Can you please help me with the shell script code where i can rename all these files in order like say for example: All my files are in the name example.csv in different subfolders. I want them to be example1.csv in subfolder1, example2.csv in subfolder2 and so on...
This is the script that would over write on the csv files.
for c in *.csv
do
echo $c
cat $c >> fullreport.csv
done
Thanks a lot for your help :)