Re: parsing an Excel formula with the re module

2010-01-14 Thread John Machin
On Jan 15, 3:41 pm, Paul McGuire 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 pretty common to ta

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 parser,

Re: parsing an Excel formula with the re module

2010-01-14 Thread John Machin
On Jan 14, 2:05 pm, "Gabriel Genellina" wrote: > En Wed, 13 Jan 2010 05:15:52 -0300, Paul McGuire   > 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 p

Re: parsing an Excel formula with the re module

2010-01-14 Thread John Machin
On Jan 13, 7:15 pm, Paul McGuire wrote: > On Jan 5, 1:49 pm, Tim Chase 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

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 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 build those parsing

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, prove

Re: parsing an Excel formula with the re module

2010-01-13 Thread Paul McGuire
On Jan 5, 1:49 pm, Tim Chase 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 functions, > > she

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 fo

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 ...w

Re: parsing an Excel formula with the re module

2010-01-06 Thread John Machin
On Jan 6, 6:54 am, vsoler wrote: > On 5 ene, 20:21, vsoler wrote: > > > > > On 5 ene, 20:05, Mensanator wrote: > > > > On Jan 5, 12:35 pm, MRAB wrote: > > > > > vsoler wrote: > > > > > Hello, > > > > > > I am acessing an Excel file by means of Win 32 COM technology. > > > > > For a given cell,

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

Re: parsing an Excel formula with the re module

2010-01-05 Thread MRAB
Mensanator wrote: On Jan 5, 12:35 pm, MRAB 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 another, how workbo

Re: parsing an Excel formula with the re module

2010-01-05 Thread vsoler
On 5 ene, 20:21, vsoler wrote: > On 5 ene, 20:05, Mensanator wrote: > > > > > On Jan 5, 12:35 pm, MRAB 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 ma

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:05, Mensanator wrote: > On Jan 5, 12:35 pm, MRAB 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, ho

Re: parsing an Excel formula with the re module

2010-01-05 Thread MRAB
vsoler wrote: On 5 ene, 19:35, MRAB 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 another, how workbooks ref

Re: parsing an Excel formula with the re module

2010-01-05 Thread Mensanator
On Jan 5, 12:35 pm, MRAB 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 > > another, how work

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

Re: parsing an Excel formula with the re module

2010-01-05 Thread vsoler
On 5 ene, 19:35, MRAB 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 > > another, how workboo

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 pa

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 formul