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


Groups > comp.lang.python > #54168

Re: Appending data to an excel sheet by python code

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.011
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'paths': 0.07; 'subject:code': 0.07; 'string': 0.09; 'append': 0.09; 'skip:f 70': 0.09; 'python': 0.11; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'literals': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'import': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'fine': 0.24; 'file.': 0.24; "haven't": 0.24; 'shown': 0.26; 'second': 0.26; 'excel': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'file:': 0.31; 'file': 0.32; 'guess': 0.33; 'raw': 0.33; 'could': 0.34; 'problem': 0.35; 'problem.': 0.35; 'received:84': 0.35; 'subject:data': 0.36; 'error.': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'read': 0.60; 'entire': 0.61; "you're": 0.61; 'more': 0.64; 'forward': 0.65; 'here': 0.66; 'header:Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'reply-to:addr:python.org': 0.84; 'subject:Appending': 0.84; 'sheet': 0.93
X-CM-Score 0.00
X-CNFS-Analysis v=2.1 cv=cNrZ7DuN c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=0kkAYlmtguIA:10 a=OCj3-oDnohMA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=Oo_2ymwi2-gA:10 a=HqWCHMZn30jbyAYhesQA:9 a=wPNLvfGTeEIA:10
X-AUTH mrabarnett:2500
Date Sat, 14 Sep 2013 18:06:27 +0100
From MRAB <python@mrabarnett.plus.com>
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version 1.0
To python-list@python.org
Subject Re: Appending data to an excel sheet by python code
References <87454429-bd36-44b2-bef1-055d976c16ae@googlegroups.com>
In-Reply-To <87454429-bd36-44b2-bef1-055d976c16ae@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To python-list@python.org
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.377.1379178380.5461.python-list@python.org> (permalink)
Lines 40
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1379178380 news.xs4all.nl 15919 [2001:888:2000:d::a6]:40915
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:54168

Show key headers only | View raw


On 14/09/2013 12:33, Manoj Rout wrote:
> hi
>    i want to append some data to an existing excel sheet by reading from  file.But here i am facing 2 problem.first is when i am reading from file.
>
>
> import re
>
It's a good idea to use raw string literals for file paths on
Windows. Alternatively, you could use forward slashes instead of
backslashes.

> file=open("C:\Workspace\WS2\P1\Dave\Generated\src\UART001\UART001_Conf.c","r")

Here you're reading the entire file:

> strings=re.search(r'(?<=(.Mode = UART_))\w+',file.read())

Here you're trying to read the entire file again, but you're already
read to its end, so you'll now get an empty string:

> string=re.search(r'(?<=(.StopBit = UART_))\w+',file.read())
>
> print strings.group()
> print string.group()
>
What's 'workbook'? Don't you mean 'file'?

> workbook.close()
>
>
>
> Here if i will read only once then it is fine and not showing any error.But if i will do it for second time i.e.2nd string i have to search and print both of them,then it is showing error.
>
You haven't shown the traceback, so I have to guess what the error was.

> And one more problem how to append some data to an existing excel sheet by python code.
>
> so can u please help me on this problem.
>

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


Thread

Appending data to an excel sheet by python code Manoj Rout <manojrout70@gmail.com> - 2013-09-14 04:33 -0700
  Re: Appending data to an excel sheet by python code MRAB <python@mrabarnett.plus.com> - 2013-09-14 18:06 +0100
  Re: Appending data to an excel sheet by python code Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-09-14 13:22 -0400
  Re: Appending data to an excel sheet by python code petmertens@gmail.com - 2013-09-14 10:28 -0700

csiph-web