Re: read file with multiple data per line

2009-04-14 Thread woooee
If this is the record, then you can use split to get a list of the individual fields and then convert to int or float where necessary. rec = "2NHST1 C1 56 3.263 2.528 16.345 " rec_split = rec.split() print rec_split If you want to read two records at a time, then use all_data = open(name,

Re: read file with multiple data per line

2009-04-14 Thread Eduardo
On Apr 14, 12:32 am, Steven D'Aprano wrote: > On Tue, 14 Apr 2009 00:15:18 -0700, Eduardo wrote: > > Hello all, > > > I googled a lot but couldn't find anything that i could consider a > > possible solution (though i am fairly new to the language and i think > > this is the main cause of my failur

Re: read file with multiple data per line

2009-04-14 Thread Piet van Oostrum
> Eduardo (E) wrote: >E> Hello all, >E> I googled a lot but couldn't find anything that i could consider a >E> possible solution (though i am fairly new to the language and i think >E> this is the main cause of my failure). >E> This is the beginning of the file i have to parse: >E> Modifie

Re: read file with multiple data per line

2009-04-14 Thread Steven D'Aprano
On Tue, 14 Apr 2009 00:15:18 -0700, Eduardo wrote: > Hello all, > > I googled a lot but couldn't find anything that i could consider a > possible solution (though i am fairly new to the language and i think > this is the main cause of my failure). You haven't actually said what the problem is.

read file with multiple data per line

2009-04-14 Thread Eduardo
Hello all, I googled a lot but couldn't find anything that i could consider a possible solution (though i am fairly new to the language and i think this is the main cause of my failure). This is the beginning of the file i have to parse: Modified System 32728 2NHST1 C1 56 3.263