help splitting strings

John Machin sjmachin at lexicon.net
Thu Apr 18 20:17:58 EDT 2002


Michael Gilfix <mgilfix at eecs.tufts.edu> wrote in message news:<mailman.1019147737.28803.python-list at python.org>...
> You definitely want to use the re module and finall
> here.  That way you can have tighter control over what
> constitutes a field.  The difficulty here is crafting your
> regular expression so it matches what you want. 
> 

Sorry to be flatly contradictory, but you definitely *don't* want
to use regular expressions to try to unravel CSV format, whether (de
facto) standard or not. Therein lie both madness and slow processing.
Take Emile's advice and use Dave Cole's CSV module. If you have data
that it doesn't handle (i.e. not "standard") then post again or send
me e-mail -- I am lashing together a module that handles non-standard
variations of CSV format.



More information about the Python-list mailing list