Code: Select all
bci_dat2stream < myfile | bci_stream2table --output=mynewfile Code: Select all
subject4/EEG/subjectTM_4/TMsubject04S001R06.tsv
Runtime Error: Unhandled exception of type std::out_of_range: vector::_M_range_check
Aborting bci_stream2tableFor reference, here is the complete script that searches for .dat files in all subdirectories and converts them to tab-separated value files with the same name. Requires the fish shell and sponge.
Code: Select all
#!/usr/bin/fish
set filelist (ls **.dat)
# echo $filelist[1]
for infile in $filelist
set outfile (basename $infile .dat)
# echo $outfile".tsv"
# echo (dirname $infile)"/$outfile".tsv
set savefile (dirname $infile)"/$outfile".tsv
echo $savefile
bci_dat2stream < $infile | bci_stream2table --output=$savefile
# Remove single hash character from file start
# sed '1s/^.//' $savefile >> $savefile
# better method
tail -c +2 $savefile | sponge $savefile
# remove first character from each line
sed 's/^.//g' $savefile | sponge $savefile
end