> hubritic (h) wrote:
>h> I want to parse a log that has entries like this:
>h> [2009-03-17 07:28:05.545476 -0500] rprt s=d2bpr80d6 m=2 mod=mail
>h> cmd=msg module=access rule=x_dynamic_ip action=discard attachments=0
>h> rcpts=1
>h>
>routes=DL_UK_ALL,NOT_DL_UK_ALL,default_inbound,firewallsa
I want to parse a log that has entries like this:
[2009-03-17 07:28:05.545476 -0500] rprt s=d2bpr80d6 m=2 mod=mail
cmd=msg module=access rule=x_dynamic_ip action=discard attachments=0
rcpts=1
routes=DL_UK_ALL,NOT_DL_UK_ALL,default_inbound,firewallsafe,mail01_mail02,spfsafe
size=4363 guid=291f0f108
On May 16, 10:45 am, Ant <[EMAIL PROTECTED]> wrote:
> Hi Paul,
>
> > LineStart *really* wants to be parsed at the beginning of a line.
> > Your textline reads up to but not including the LineEnd. Try making
> > these changes.
>
> > 1. Change textline to:
>
> > textline = pp.Combine(
> >
Hi Paul,
LineStart *really* wants to be parsed at the beginning of a line.
Your textline reads up to but not including the LineEnd. Try making
these changes.
1. Change textline to:
textline = pp.Combine(
pp.Group(pp.Word(pp.alphas, pp.printables) + pp.restOfLine)) +
\
pp.
On May 16, 6:43 am, Ant <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have a question on PyParsing. I am trying to create a parser for a
> hierarchical todo list format, but have hit a stumbling block. I have
> parsers for the header of the list (title and description), and the body
> (recursive desce
On May 16, 6:43 am, Ant <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have a question on PyParsing. I am trying to create a parser for a
> hierarchical todo list format, but have hit a stumbling block. I have
> parsers for the header of the list (title and description), and the body
> (recursive desce
Hi all,
I have a question on PyParsing. I am trying to create a parser for a
hierarchical todo list format, but have hit a stumbling block. I have
parsers for the header of the list (title and description), and the body
(recursive descent on todo items).
Individually they are working fine, c
On Jan 1, 5:32 pm, hubritic <[EMAIL PROTECTED]> wrote:
> I am trying to parse data that looks like this:
>
> IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION
> 2BFA76F6 1208230607 T S SYSPROC SYSTEM
> SHUTDOWN BY USER
> A6D1BD62 1215230807 I
> H
On Jan 1, 4:18 pm, John Machin <[EMAIL PROTECTED]> wrote:
> On Jan 2, 10:32 am, hubritic <[EMAIL PROTECTED]> wrote:
>
> > The data I have has a fixed number of characters per field, so I could
> > split it up that way, but wouldn't that defeat the purpose of using a
> > parser?
>
> The purpose of a
On Jan 2, 10:32 am, hubritic <[EMAIL PROTECTED]> wrote:
> The data I have has a fixed number of characters per field, so I could
> split it up that way, but wouldn't that defeat the purpose of using a
> parser?
The purpose of a parser is to parse. Data in fixed columns does not
need parsing.
>
On Jan 1, 2008 6:54 PM, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> There's no standard Python tool for reading and writing fixed-length field
> "flatfile" data files, but it's pretty simple to use named slices to get at
> the data.
>
> identifier = slice(0, 8)
> timestamp = slice(8, 18)
> t = slice
On Jan 1, 2008 6:32 PM, hubritic <[EMAIL PROTECTED]> wrote:
> I am trying to parse data that looks like this:
>
> IDENTIFIERTIMESTAMP T C RESOURCE_NAME DESCRIPTION
> 2BFA76F6 1208230607 T S SYSPROCSYSTEM
> SHUTDOWN BY USER
> A6D1BD62 1215230807 I
> H
I am trying to parse data that looks like this:
IDENTIFIERTIMESTAMP T C RESOURCE_NAME DESCRIPTION
2BFA76F6 1208230607 T S SYSPROCSYSTEM
SHUTDOWN BY USER
A6D1BD62 1215230807 I
HFirmware Event
My problem is t
> Welcome to pyparsing! The simplest way to implement a markup processor in
> pyparsing is to define the grammar of the markup, attach a parse action to
> each markup type to convert the original markup to the actual results, and
> then use transformString to run through the input and do the conv
"Ant" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I have a home-grown Wiki that I created as an excercise, with it's own
> wiki markup (actually just a clone of the Trac wiki markup). The wiki
> text parser I wrote works nicely, but makes heavy use of regexes, tags
> and stacks to
Ant wrote:
> So I thought I'd look into the pyparsing module, but can't find a
> simple example of processing random text.
Have you looked at the examples on the pyparsing web page?
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
I have a home-grown Wiki that I created as an excercise, with it's own
wiki markup (actually just a clone of the Trac wiki markup). The wiki
text parser I wrote works nicely, but makes heavy use of regexes, tags
and stacks to parse the text. As such it is a bit of a mantainability
nightmare - addin
17 matches
Mail list logo