Raw data extraction question

Discussion in 'Python' started by Maggie, Aug 26, 2009.

  1. Maggie

    Maggie Guest

    i have event timing stretch of code i need to alter. here is code
    below:
    --------------
    # we start each run with one full silent trial
    # creating a "stub" with the duration of a full block
    # less the discarded acquisitions
    stub = block_dur - (distax * tr)

    feed = sys.stdin.readlines()
    sess = -1
    for line in feed:
    if re.search(line != rest):
    time = (line + line (-1)) + (distax * tr)
    print time

    elif (line(-1) = rest):
    # block onsets are determined by
    # block number, block duration,
    # and the stub; 3dDeconvolve
    # takes care of making these
    # "global"
    time = (line) + (distax * tr)
    print time
    -----
    my concern is that it is extracting line number and not data contained
    on a given line. I need it to extract data from each line (excluding
    lines with spaces and/or lines that contain the word "pause" or
    "silence"). Basically i need ONLY raw data extracted from line 1 -
    onward.

    Please let me know if you have any suggestions.

    Thanks!
     
    Maggie, Aug 26, 2009
    #1
    1. Advertising

  2. En Wed, 26 Aug 2009 12:18:23 -0300, Maggie <> escribió:

    > i have event timing stretch of code i need to alter. here is code
    > below:
    > --------------
    > # we start each run with one full silent trial
    > # creating a "stub" with the duration of a full block
    > # less the discarded acquisitions
    > stub = block_dur - (distax * tr)
    >
    > feed = sys.stdin.readlines()
    > sess = -1
    > for line in feed:
    > if re.search(line != rest):
    > time = (line + line (-1)) + (distax * tr)
    > print time
    >
    > elif (line(-1) = rest):
    > # block onsets are determined by
    > # block number, block duration,
    > # and the stub; 3dDeconvolve
    > # takes care of making these
    > # "global"
    > time = (line) + (distax * tr)
    > print time
    > -----


    When you post some piece of code, copy & paste it from the original
    source; don't retype. The code above don't even compile.

    > my concern is that it is extracting line number and not data contained
    > on a given line. I need it to extract data from each line (excluding
    > lines with spaces and/or lines that contain the word "pause" or
    > "silence"). Basically i need ONLY raw data extracted from line 1 -
    > onward.


    How does a line look like? Post some sample lines.

    --
    Gabriel Genellina
     
    Gabriel Genellina, Aug 28, 2009
    #2
    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. Di'ego

    Clock and data extraction

    Di'ego, Dec 21, 2003, in forum: VHDL
    Replies:
    0
    Views:
    464
    Di'ego
    Dec 21, 2003
  2. Manasa
    Replies:
    2
    Views:
    774
    Mothra
    May 19, 2004
  3. madhukp

    Data extraction from MS Word file

    madhukp, Feb 9, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    493
    Steve C. Orr [MVP, MCSD]
    Feb 9, 2004
  4. Replies:
    6
    Views:
    527
    Carlos Eduardo Lima Borges
    Jul 7, 2006
  5. Dave Kuhlman

    HTML data extraction?

    Dave Kuhlman, Dec 22, 2003, in forum: Python
    Replies:
    2
    Views:
    383
    John J. Lee
    Dec 22, 2003
Loading...

Share This Page