Multiple CSV file into one excel file using shell script

Hello Experts,

I have a folder in UNIX envirnment where I have multiple CSV files with one sheet each.
Now I want to put all the CSV files sheets into one excel file.

Can we do this in some shell script ?

Please help..
LVL 17
Swadhin RaySenior Technical Engineer Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
RingthaneConnect With a Mentor Commented:
I assume you need an XLS outputfile. If so: write a Perl program using perl functions to read and split the CSV lines and John MacNamara's excelent WriteExcel CPAN lib to create the Excel file.
0
 
arnoldCommented:
cat *.csv > combined.csv

Do all have column headings?
0
 
Swadhin RaySenior Technical Engineer Author Commented:
The columns heading can be different ..
So need to put each sheet of the each CSV file in to one excel file.
0
 
wesly_chenCommented:
1.  CSV files with one sheet each.
2.  put each sheet of the each CSV file in to one excel file.

Based on your requirement, there is no need to covert each csv into excel file.
MS Excel can open csv file directly.
0
 
arnoldCommented:
If you simply want to have them all concatenated into a single file, there is no need for a shell script.  The directive I posted will do it for all files in the directory that have the .cvs suffix will be combined into the single file which you then can load into excel..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.