Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python to Combine Multiple Excel Worksheets into One Worksheet

Reply
Thread Tools

Python to Combine Multiple Excel Worksheets into One Worksheet

 
 
SMac2347@comcast.net
Guest
Posts: n/a
 
      02-15-2012
Hello,

I have one single Excel file with many separate worksheets, and for
work I need to combine all these separate worksheets into one single
worksheet (I am not worried about formatting, as the format is the
same in each sheet, nor am I worried about Excel's row limit).
Essentially, I am looking for a way to append the data in one sheet to
the bottom of the sheet that proceeds it.

What would be the best way to do this, and how would I go about doing
it? Can it be done simply with the xlwt, xlrd, and xutils modules, or
(as I was thinking) do I need to convert the sheets to separate csv
files, then append the separate csv files, and then write the
completed file back into .xls format? Or perhaps something else?

As I am really only a Python beginner, any and all help is very much
appreciated. Thank you in advance!!
 
Reply With Quote
 
 
 
 
Prasad, Ramit
Guest
Posts: n/a
 
      02-16-2012
>I have one single Excel file with many separate worksheets, and for work Ineed to combine all these separate worksheets into one single worksheet (Iam not worried about formatting, as the format is the same in each sheet, nor am I worried about Excel's row limit).

>Essentially, I am looking for a way to append the data in one sheet to the bottom of the sheet thatproceeds it.


>What would be the best way to do this, and how would I go about doing it? Can it be done simply with the xlwt, xlrd, and xutils modules, or (as I was thinking) do I need to convert the sheets to separate csv files, then append the separate csv files, and then write the completed file back into .xls format? >Or perhaps something else?


>As I am really only a Python beginner, any and all help is very much appreciated. Thank you in advance!!


Read the data from the different worksheets using xlrd and then use xlwt to write to a single worksheetin a new excel file. The csv option is probably not useful since it willjust add an intermediary step unless you are converting outside of python (i.e. manually).

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--

This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Render TIFF Image from Worksheets, Add Header/Footer to Worksheets sherazam Java 0 11-27-2012 09:26 AM
Need better solution to export from sql server to multiple worksheets in excel in vb.net app Nik ASP .Net 1 03-21-2012 06:43 PM
How to make COPY of Worksheet(1) to some other Worksheet ??? Katja Perl Misc 1 01-14-2008 10:26 AM
excel.h - Automating Excel... How to Create new worksheets Jona C++ 2 07-06-2007 03:35 PM
adding an excel worksheet to a generetad excel file via perl FlorianKraft@gmx.de Perl Misc 1 04-17-2007 12:53 PM



Advertisments