Solved

Multiple CSV file into one excel file using shell script

Posted on 2011-09-07
5
3,616 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 78

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 78

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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
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.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

696 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