#!/bin/sh filename=stim1.txt tr=3.5 b1times=`grep b1 $filename | awk '{print $3}'` for t in $b1times ; do tsec=`echo $t \* $tr | bc` echo "$tsec 30.0 1.0" >> stim1_b1.txt done b2times=`grep b2 $filename | awk '{print $3}'` for t in $b2times ; do tsec=`echo $t \* $tr | bc` echo "$tsec 30.0 1.0" >> stim1_b2.txt done