[TriZPUG] More Fun With Text Processing
Bradley A. Crittenden
brad.crittenden at gmail.com
Fri Apr 3 18:13:22 CEST 2009
On Apr 3, 2009, at 12:03 , Chris Rossi wrote:
> Or maybe it's already outputting tab characters?
> On Fri, Apr 3, 2009 at 11:51 AM, Stephan Altmueller <stephan_altmueller at unc.edu
> > wrote:
> I think the first thing you should do is nail down the exact file
> If you have missing values and spaces in your format you have no
> unambiguous way
> to decide what column an entry belongs to.
> Can you make the command line program insert some sort of delimiter
> commas ?
If your input does have a consistent delimiter you may want to look at
csv.DictReader, which can read the headers and use them as keys to a
dictionary it returns you. The module is called 'csv', but you can
supply any delimiter to it.
More information about the TriZPUG