how to build Object for List data

Joel Goldstick joel.goldstick at gmail.com
Mon Oct 8 15:13:44 EDT 2012


On Mon, Oct 8, 2012 at 2:50 PM, Laszlo Nagy <gandalf at shopzeus.com> wrote:
>>
>> Seq  validation
>> 1       Program3,1,3,4      # max(F1,F3) to F4
>> ......
>> n
>> How to using python to Read the text file, Build the data as object
>> class ?
>
> Open the file using the open() command. Then iterate over the lines within a
> stateful algorithm that parses the lines with regular expressions.

before you go the regex route try str.split() since it looks like your
columns are separated by tabs or spaces.  You could also look into csv
package.

>
> What did you try so far?
> --
> http://mail.python.org/mailman/listinfo/python-list



-- 
Joel Goldstick



More information about the Python-list mailing list