Soumen banerjee <soume...@gmail.com> wrote: > Hello > I have not tried the code because in no part of the code is the array > "out" being created. As such, it is bound to return an error that out > isnt created. The point here is how i can get sampled values from the > dat file which has lines like this:- > > <sampling Time> <sampled Value> \r\n > > i need to isolate the sampled values and put them into an array.
Maybe something like: samples = [] with open('myfile') as f: for line in f: time, value = line.strip().split() samples.append([float(time), float(value)]) Modify as appropriate to your actual needs. -- R. David Murray http://www.bitdance.com -- http://mail.python.org/mailman/listinfo/python-list