Re: Fast forward-backward (write-read)

Discussion in 'Python' started by Tim Chase, Oct 24, 2012.

  1. Tim Chase

    Tim Chase Guest

    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
    Tim Chase, Oct 24, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Virgil Stokes

    Fast forward-backward (write-read)

    Virgil Stokes, Oct 23, 2012, in forum: Python
    Replies:
    7
    Views:
    144
    Virgil Stokes
    Oct 25, 2012
  2. Tim Chase
    Replies:
    0
    Views:
    172
    Tim Chase
    Oct 23, 2012
  3. Dennis Lee Bieber

    Re: Fast forward-backward (write-read)

    Dennis Lee Bieber, Oct 23, 2012, in forum: Python
    Replies:
    0
    Views:
    133
    Dennis Lee Bieber
    Oct 23, 2012
  4. Virgil Stokes

    Re: Fast forward-backward (write-read)

    Virgil Stokes, Oct 23, 2012, in forum: Python
    Replies:
    4
    Views:
    188
    Tim Golden
    Oct 24, 2012
  5. Virgil Stokes

    Re: Fast forward-backward (write-read)

    Virgil Stokes, Oct 23, 2012, in forum: Python
    Replies:
    0
    Views:
    111
    Virgil Stokes
    Oct 23, 2012
Loading...

Share This Page