Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #20524

RE: Python to Combine Multiple Excel Worksheets into One Worksheet

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ramit.prasad@jpmorgan.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'completeness': 0.05; 'subject:Python': 0.05; 'python': 0.08; 'append': 0.09; 'csv': 0.09; 'format?': 0.09; 'converting': 0.15; 'to:name:python- list@python.org': 0.15; '712': 0.16; '>or': 0.16; '>what': 0.16; 'currencies': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'from:addr:jpmorgan.com': 0.16; 'received:155.180': 0.16; 'received:155.180.234': 0.16; 'received:159.53': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:svr.bankone.net': 0.16; 'row': 0.16; 'securities,': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'worried': 0.16; 'xlrd': 0.16; '(i.e.': 0.17; 'header:In- Reply-To:1': 0.22; 'convert': 0.25; 'received:169': 0.28; 'received:169.254': 0.28; 'separate': 0.28; 'modules,': 0.30; 'received:155': 0.30; 'received:159': 0.30; '(as': 0.31; 'file.': 0.31; 'accuracy': 0.32; 'it.': 0.33; 'it?': 0.33; 'appreciated.': 0.34; 'file': 0.34; 'done': 0.34; 'thank': 0.35; 'probably': 0.35; 'to:addr:python-list': 0.35; 'phone:': 0.35; 'something': 0.35; 'charset:us-ascii': 0.37; 'using': 0.37; 'doing': 0.38; 'format': 0.38; 'useful': 0.38; 'data': 0.38; 'option': 0.39; 'unless': 0.39; 'to:addr:python.org': 0.40; 'back': 0.60; 'subject': 0.61; 'offers': 0.62; 'bottom': 0.64; 'information,': 0.69; 'legal': 0.72; 'url:email': 0.72; 'bank': 0.75; 'sale': 0.75; 'subject:One': 0.77; 'investment': 0.77; 'purchase': 0.78; 'received:169.254.8': 0.84; 'sheets': 0.84; 'worksheet': 0.84; 'worksheets': 0.91; 'sheet': 0.96
X-DKIM OpenDKIM Filter v2.1.3 sz1.jpmchase.com q1GL6cuM002837
DKIM-Signature v=1; a=rsa-sha256; c=simple/simple; d=jpmorgan.com; s=smtpout; t=1329426398; bh=+ggkfGszoJjt6pV7jRYewoQzTeiLhBl9lzh6vr5TX4A=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=G+w4Khw2o8Qs43fTueCNMDtztoMUhiTkO9AnpUVQBlv70w4/Z3l1XeD8AUO1Jrvm4 rmjzzCAcoqWNbgn02jbiDR5ABaMST0DiBTOesEfFhl+JzesA1pGt1CwpJr0vXuqOH9 5VJ49cJ62wEtz1maKbK75OxqvgcflMmika2cxroE=
From "Prasad, Ramit" <ramit.prasad@jpmorgan.com>
To "python-list@python.org" <python-list@python.org>
Subject RE: Python to Combine Multiple Excel Worksheets into One Worksheet
Thread-Topic Python to Combine Multiple Excel Worksheets into One Worksheet
Thread-Index AQHM7BYlUV6Lh0ZM+k2csWoEFOHmjJZABJ0g
Date Thu, 16 Feb 2012 21:06:27 +0000
References <657c4fb5-db56-4bd5-b5a7-112d1d673fbb@d15g2000yqg.googlegroups.com>
In-Reply-To <657c4fb5-db56-4bd5-b5a7-112d1d673fbb@d15g2000yqg.googlegroups.com>
Accept-Language en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
x-originating-ip [10.67.79.38]
Content-Transfer-Encoding quoted-printable
MIME-Version 1.0
X-DLP-FWD Yes
Content-Type text/plain; charset="us-ascii"
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5899.1329426408.27778.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1329426408 news.xs4all.nl 6841 [2001:888:2000:d::a6]:50726
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:20524

Show key headers only | View raw


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

Read the data from the different worksheets using xlrd and then use xlwt to write to a single worksheet in a new excel file. The csv option is probably not useful since it will just 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.  

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Python to Combine Multiple Excel Worksheets into One Worksheet SMac2347@comcast.net - 2012-02-15 11:11 -0800
  RE: Python to Combine Multiple Excel Worksheets into One Worksheet "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-02-16 21:06 +0000

csiph-web