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


Groups > comp.lang.python > #8214

Re: Python Regular Expressions

From Neil Cerutti <neilc@norwich.edu>
Newsgroups comp.lang.python
Subject Re: Python Regular Expressions
Date 2011-06-22 14:58 +0000
Organization Norwich University
Message-ID <96ee9bFlrrU1@mid.individual.net> (permalink)
References <3b65fd1f-d377-49b8-b00a-f80462a1213d@35g2000prp.googlegroups.com> <77c4973c-7315-4b4d-8eae-3f5770dfb530@22g2000prx.googlegroups.com>

Show all headers | View raw


On 2011-06-22, Andy Barnes <andy.barnes@gmail.com> wrote:
> to expand. I have parsed one of the lines manually to try and break
> the process I'm trying to automate down.
>
> source:
> Theurgic Lore, Lore, n/a, 105, 70, 30, Distil Mana
>
> output:
> TheurgicLore [label="{ Theurgic Lore |{Lore|n/a}|{105|70|30}}"];
> DistilMana -> TheurgicLore;
>
> This is the steps I would take to do this conversion manually:

It seems to me that parsing the file into an intermediate model
and then using that model to serialize your output would be
easier to understand and more robust than modifying the csv
entries in place. It decouples deciphering the meaning of the
data from emitting the data, which is more robust and expansable.

The amount of ingenuity required is less, though. ;)

-- 
Neil Cerutti

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


Thread

Python Regular Expressions Andy  Barnes <andy.barnes@gmail.com> - 2011-06-22 07:00 -0700
  Re: Python Regular Expressions Andy Barnes <andy.barnes@gmail.com> - 2011-06-22 07:26 -0700
    Re: Python Regular Expressions Neil Cerutti <neilc@norwich.edu> - 2011-06-22 14:58 +0000
  Re: Python Regular Expressions Peter Otten <__peter__@web.de> - 2011-06-22 17:05 +0200
  Re: Python Regular Expressions Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-06-22 21:50 -0700

csiph-web