Re: parsing an Excel formula with the re module

2010-01-14 Thread John Machin
On Jan 13, 7:15 pm, Paul McGuire pt...@austin.rr.com wrote: On Jan 5, 1:49 pm, Tim Chase python.l...@tim.thechases.com wrote: vsoler wrote: Hence, I need toparseExcel formulas. Can I do it by means only of re (regular expressions)? I know that for simple formulas such as =3*A7+5 it

Re: parsing an Excel formula with the re module

2010-01-14 Thread John Machin
On Jan 14, 2:05 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Wed, 13 Jan 2010 05:15:52 -0300, Paul McGuire pt...@austin.rr.com   escribió: vsoler wrote: Hence, I need toparseExcel formulas. Can I do it by means only of re (regular expressions)? This might give the OP a

Re: parsing an Excel formula with the re module

2010-01-14 Thread Paul McGuire
I never represented that this parser would handle any and all Excel formulas! But I should hope the basic structure of a pyparsing solution might help the OP add some of the other features you cited, if necessary. It's actually pretty common to take an incremental approach in making such a

Re: parsing an Excel formula with the re module

2010-01-14 Thread John Machin
On Jan 15, 3:41 pm, Paul McGuire pt...@austin.rr.com wrote: I never represented that this parser would handle any and all Excel formulas!  But I should hope the basic structure of a pyparsing solution might help the OP add some of the other features you cited, if necessary. It's actually

Re: parsing an Excel formula with the re module

2010-01-13 Thread Paul McGuire
On Jan 5, 1:49 pm, Tim Chase python.l...@tim.thechases.com wrote: vsoler wrote: Hence, I need toparseExcel formulas. Can I do it by means only of re (regular expressions)? I know that for simple formulas such as =3*A7+5 it is indeed possible. What about complex for formulas that include

Re: parsing an Excel formula with the re module

2010-01-13 Thread Chris Withers
John Machin wrote: The OP was planning to dig the formula text out using COM then parse the formula text looking for cell references and appeared to have a rather simplistic view of the ease of parsing Excel formula text -- that's why I pointed him at those facilities (existing, released,

Re: parsing an Excel formula with the re module

2010-01-13 Thread Gabriel Genellina
En Wed, 13 Jan 2010 05:15:52 -0300, Paul McGuire pt...@austin.rr.com escribió: vsoler wrote: Hence, I need toparseExcel formulas. Can I do it by means only of re (regular expressions)? This might give the OP a running start: from pyparsing import (CaselessKeyword, Suppress, ... Did you

Re: parsing an Excel formula with the re module

2010-01-12 Thread Chris Withers
John Machin wrote: The xlwt package (of which I am the maintainer) has a lexer and parser for a largish subset of the syntax ... see http://pypi.python.org/pypi/xlwt xlrd, no? Also worth pointing out that the topic of Python and Excel has its own web site: http://www.python-excel.org

Re: parsing an Excel formula with the re module

2010-01-12 Thread John Machin
On 12/01/2010 6:26 PM, Chris Withers wrote: John Machin wrote: The xlwt package (of which I am the maintainer) has a lexer and parser for a largish subset of the syntax ... see http://pypi.python.org/pypi/xlwt xlrd, no? A facility in xlrd to decompile Excel formula bytecode into a text

Re: parsing an Excel formula with the re module

2010-01-06 Thread John Machin
On Jan 6, 6:54 am, vsoler vicente.so...@gmail.com wrote: On 5 ene, 20:21, vsoler vicente.so...@gmail.com wrote: On 5 ene, 20:05, Mensanator mensana...@aol.com wrote: On Jan 5, 12:35 pm, MRAB pyt...@mrabarnett.plus.com wrote: vsoler wrote: Hello, I am acessing an Excel

parsing an Excel formula with the re module

2010-01-05 Thread vsoler
Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets reference one another, how workbooks reference one another, etc. Hence, I need to parse Excel

Re: parsing an Excel formula with the re module

2010-01-05 Thread MRAB
vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets reference one another, how workbooks reference one another, etc. Hence, I need to

Re: parsing an Excel formula with the re module

2010-01-05 Thread vsoler
On 5 ene, 19:35, MRAB pyt...@mrabarnett.plus.com wrote: vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets reference one

Re: parsing an Excel formula with the re module

2010-01-05 Thread John Posner
On Tue, 05 Jan 2010 13:12:00 -0500, vsoler vicente.so...@gmail.com wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets reference one another,

Re: parsing an Excel formula with the re module

2010-01-05 Thread Mensanator
On Jan 5, 12:35 pm, MRAB pyt...@mrabarnett.plus.com wrote: vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets reference one

Re: parsing an Excel formula with the re module

2010-01-05 Thread MRAB
vsoler wrote: On 5 ene, 19:35, MRAB pyt...@mrabarnett.plus.com wrote: vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets reference one

Re: parsing an Excel formula with the re module

2010-01-05 Thread vsoler
On 5 ene, 20:05, Mensanator mensana...@aol.com wrote: On Jan 5, 12:35 pm, MRAB pyt...@mrabarnett.plus.com wrote: vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells

Re: parsing an Excel formula with the re module

2010-01-05 Thread Tim Chase
vsoler wrote: Hence, I need to parse Excel formulas. Can I do it by means only of re (regular expressions)? I know that for simple formulas such as =3*A7+5 it is indeed possible. What about complex for formulas that include functions, sheet names and possibly other *.xls files? Where things

Re: parsing an Excel formula with the re module

2010-01-05 Thread vsoler
On 5 ene, 20:21, vsoler vicente.so...@gmail.com wrote: On 5 ene, 20:05, Mensanator mensana...@aol.com wrote: On Jan 5, 12:35 pm, MRAB pyt...@mrabarnett.plus.com wrote: vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am

Re: parsing an Excel formula with the re module

2010-01-05 Thread MRAB
Mensanator wrote: On Jan 5, 12:35 pm, MRAB pyt...@mrabarnett.plus.com wrote: vsoler wrote: Hello, I am acessing an Excel file by means of Win 32 COM technology. For a given cell, I am able to read its formula. I want to make a map of how cells reference one another, how different sheets

Re: parsing an Excel formula with the re module

2010-01-05 Thread Steve Holden
Tim Chase wrote: vsoler wrote: Hence, I need to parse Excel formulas. Can I do it by means only of re (regular expressions)? I know that for simple formulas such as =3*A7+5 it is indeed possible. What about complex for formulas that include functions, sheet names and possibly other *.xls