?
Solved

Multiple CSV file into one excel file using shell script

Posted on 2011-09-07
5
Medium Priority
?
3,878 Views
Last Modified: 2012-05-12
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
Comment
Question by:Swadhin Ray
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 79

Expert Comment

by:arnold
ID: 36496219
cat *.csv > combined.csv

Do all have column headings?
0
 
LVL 16

Author Comment

by:Swadhin Ray
ID: 36496988
The columns heading can be different ..
So need to put each sheet of the each CSV file in to one excel file.
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 36497694
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
 
LVL 79

Expert Comment

by:arnold
ID: 36498206
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
 
LVL 2

Accepted Solution

by:
Ringthane earned 2000 total points
ID: 36501133
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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Fine Tune your automatic Updates for Ubuntu / Debian
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month13 days, 9 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question