[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4256
  • Last Modified:

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..
0
Swadhin Ray
Asked:
Swadhin Ray
1 Solution
 
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
 
RingthaneCommented:
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

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now