Entering edit mode
6.1 years ago
User 7754
▴
270
Hi,
I get an error for having an extra tab but removing the extra tab does not solve the error, has anybody run into this?
cat bed1.txt bed2.txt | sort -k1,1 -k2,2n | mergeBed -i stdin > merged.bed
Error: Type checker found wrong number of fields while tokenizing data line. Perhaps you have extra TAB at the end of your line? Check with "cat -t"
sed 's/\t$//' bed1.txt > bed1.corrected.txt
Doesn't work. I also tried to replace all spaces/tabs and then reformat into a tab-delimited, but I get the same error.
awk '{$1=$1};1' bed1.txt | sed 's/ /\t/g' > bed1.corrected.txt
did you try this ?
Yes; but shouldn't the sed command get rid of them?
none of your commands above remove the trailing tabs.
try
Hi Pierre, thank you, I have tried that but I still get the same error after doing that to each bed file: cat bed1.corrected.txt bed2.corrected.txt | sort -k1,1 -k2,2n | mergeBed -i stdin > merged.bed