Re: Reading a tab delimited text file.

2009-02-23 Thread harijay
You could also use the csv module import csv myfileobj = open("myfiletab.txt","read") csv_read = csv.reader(myfileobj,dialect=csv.excel_tab) myval1 = [] myval2 = [] myval3 = [] for line in csv_read: # filter header and stuff using some criterion if len(line) = 3: myval1.append(line[0])

Re: Reading a tab delimited text file.

2009-02-23 Thread Tim Chase
time_vec, ch1_vec, and_so_on = zip(*( map(float, line.split()) for line in file('in.txt'))) If this isn't homework, there are some less terse versions which are a bit easier on the eyes and less like some love-child between Perl and Python. haha, no this isn't homework. I'm a mecha

Re: Reading a tab delimited text file.

2009-02-23 Thread Mel
Stephen wrote: > Hi, > > I would like to read a text file of numbers produced by a data > acquisition system into three vectors of doubles. The contents of the > file are: > > +0.000e+0 +2.7645134e+1 +2.7745625e+1 > > +0.4100041e-1 +2.7637787e+1 +2.7731047e+1 > > +0.0820008e+0 +2.76451

Re: Reading a tab delimited text file.

2009-02-23 Thread Stephen
On Feb 23, 4:06 pm, Tim Chase wrote: > > I would like to read a text file of numbers produced by a data > > acquisition system into three vectors of doubles. The contents of the > > file are: > > > +0.000e+0      +2.7645134e+1   +2.7745625e+1 > > +0.4100041e-1      +2.7637787e+1   +2.7731047e+

Re: Reading a tab delimited text file.

2009-02-23 Thread Tim Chase
I would like to read a text file of numbers produced by a data acquisition system into three vectors of doubles. The contents of the file are: +0.000e+0 +2.7645134e+1 +2.7745625e+1 +0.4100041e-1 +2.7637787e+1 +2.7731047e+1 +0.0820008e+0 +2.7645134e+1 +2.7750483e+1 ... or +0.

Reading a tab delimited text file.

2009-02-23 Thread Stephen
Hi, I would like to read a text file of numbers produced by a data acquisition system into three vectors of doubles. The contents of the file are: +0.000e+0 +2.7645134e+1 +2.7745625e+1 +0.4100041e-1 +2.7637787e+1 +2.7731047e+1 +0.0820008e+0 +2.7645134e+1 +2.7750483e+1 ... or +