Open kousu opened 3 years ago
I can fix this with
awk '
BEGIN {
OFS=FS="\t";
ORS=RS="\r\n";
}
{ for(i=1; i<=7; i++) {
if($i=="") {
$i = "n/a"
}
};
print }' participants.tsv
(some subtleties: it's TSV so FS="\t"
, it's using dos line endings so RS="\r\n"
, and I manually counted the number of fields there should be instead of using NF)
Oh actually, this TSV file is a mix of dos and unix line endings, and the last line is missing a line ending entirely. https://bids-specification.readthedocs.io/en/stable/02-common-principles.html#tabular-files doesn't say anything about line endings. I'm going to force them all to unix format:
cat participants.tsv | (tr -d "\r";) | awk '
BEGIN {
OFS=FS="\t";
}
{ for(i=1; i<=7; i++) {
if($i=="") {
$i = "n/a"
}
};
print }' > p
mv p participants.tsv
git add participants.tsv
git commit
This fix is on ng/bids-validate
, can you take a look at it, @alexfoias ?
It is many thousands of lines to vet. Maybe you can write a python script that loads both TSV files and compares values to make sure I didn't delete one by accident?
The participants index is incorrectly formatted. It has blanks where the BIDS standard wants the string "n/a":