Processing a Stimulus File

The object of this exercise is to extract the timing information and use it to make a FEAT custom EV file (3 column).
  1. An example stimulus file
    The file stim1.txt contains information about stimulus timings for an event related experiment. The format is:
    Event No.  Condition Code   Onset Time   Comment

    View this file to see what it contains and how it is formatted.

  2. Extract lines for a single condition
    Using grep extract all the lines in the file that contain b1.

  3. Extract the timing column
    Using awk extract just the timing column from these b1 lines.
    Save the timing values as a variable.

  4. Creating the additional columns
    Append two columns (fixed duration of 30.0 and value of 1.0) after the timing number for each line to get a valid 3 column format for FEAT.
    Hint: use a for loop over the values
    Save the results in a file called stim1_b1.txt

  5. Processing the other condition(s)
    Repeat the above for condition b2.

  6. Changing the TR (Advanced)
    If the time information was in TRs (volume number) rather than seconds, use bc to convert this to seconds given a TR of 3.5 seconds.

    Look here for the basic cheat or the fancy cheat.