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: 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" To: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 >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)=2E=0D=0A>Essentially, I am lookin= g for a way to append the data in one sheet to the bottom of the sheet that= proceeds it=2E=0D=0A=0D=0A>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 x= utils modules, or (as I was thinking) do I need to convert the sheets to se= parate csv files, then append the separate csv files, and then write the co= mpleted file back into =2Exls format? >Or perhaps something else?=0D=0A=0D= =0A>As I am really only a Python beginner, any and all help is very much ap= preciated=2E Thank you in advance!!=0D=0A=0D=0ARead the data from the diffe= rent worksheets using xlrd and then use xlwt to write to a single worksheet= in a new excel file=2E The csv option is probably not useful since it will= just add an intermediary step unless you are converting outside of python = (i=2Ee=2E manually)=2E=0D=0A=0D=0ARamit=0D=0A=0D=0A=0D=0ARamit Prasad | JPM= organ Chase Investment Bank | Currencies Technology=0D=0A712 Main Street | = Houston, TX 77002=0D=0Awork phone: 713 - 216 - 5423=0D=0A=0D=0A--=0D=0A=0D= =0AThis email is confidential and subject to important disclaimers and=0D= =0Aconditions including on offers for the purchase or sale of=0D=0Asecuriti= es, accuracy and completeness of information, viruses,=0D=0Aconfidentiality= , legal privilege, and legal entity disclaimers,=0D=0Aavailable at http://w= ww=2Ejpmorgan=2Ecom/pages/disclosures/email=2E