Fast forward-backward (write-read)
Tim Chase
python.list at tim.thechases.com
Tue Oct 23 20:30:54 EDT 2012
On 10/23/12 13:37, Virgil Stokes wrote:
> Yes, I do wish to inverse the order, but the "forward in time"
> file will be in binary.
Your original post said:
> The data (t_k,y(t_k)), k = 0,1,...,N are stored in ASCII format
making it hard to know what sort of data is in this file.
So I guess it would help to have some sample data to work with, even
if it's just some dummy data and a raw processing loop without doing
anything inside it. Something like the output of either of these
$ xxd forward_data.txt | head -50 > forward_head.txt
$ od forward_data.txt | head -50 > forward_head.txt
plus a basic loop to show how you're extracting the values:
for line in file("forward_head.txt"):
data1, data2, data3 = process(line)
and how you want to reverse over them:
for line in file("reversed.txt"):
if same_processing_as_forward_source:
data1, data2, data3 = process(line)
else:
data1, data2, data3 = other_process(line)
or do you want something more like
for line in super_reverse_magic(file("forward_head.txt")):
data1, data2, data3 = process(line)
?
-tkc
More information about the Python-list
mailing list