Skip to content

Commit d0046b8

Browse files
authored
Create convertOnsetTimes_ToneCountingFSL.sh
1 parent 5112063 commit d0046b8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

convertOnsetTimes_ToneCountingFSL.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
#Check whether the file subjList.txt exists; if not, create it
4+
if [ ! -f subjList.txt ]; then
5+
ls -d sub-?? > subjList.txt
6+
fi
7+
8+
#Loop over all subjects and format timing files into FSL format
9+
for subj in `cat subjList.txt` ; do
10+
cd $subj/func #Navigate to the subject's func directory, which contains the timing files
11+
12+
cat ${subj}_task-tonecounting_events.tsv | awk '{if (NR!=1 && $5=="") {print $1, $2, "1"}}' > toneCount_run1.txt
13+
cat ${subj}_task-tonecounting_events.tsv | awk '{if ($5=="probe") {print $1, $2, "1"}}' > toneProbe_run1.txt
14+
15+
cd ../..
16+
done

0 commit comments

Comments
 (0)