我有一个遵循这种模式的文件:
@ERR202858.267 267 length=100
CGGCCATGCGCGCGGTAGCATATGCATCCTTGCCCTGTTGTTA
+ERR202858.267 267 length=100
BDE@EBFFEFD9DCCGGDE7FBCFF>A5D?758@:BE?BF??<
@ERR202858.268 268 length=100
ATAGGCTCCACGCCTGGTGGTGCCCTTCCGTCAATTCCTTTAAGTT
+ERR202858.268 268 length=100
FFEFEFFFFB@>=D9B>7AB>C4C>@C@?BD??6A=;+,@B@3@@>
我有另一个处理此文件的脚本:
awk -v header=$header '{if($0~header){if(i>0){printf "\n"$0}else{printf $0}}else{printf "\t"$0};i++}END{printf "\n"}' $1 > $basename1"_tab.tab"
变量“$ header”应为@ERR202858.
但是,我为一个文件获取此错误:
...
@ERR202858.271 271 length=100 GAACTCTTCCCAGGGCCGATGCCGATGTCTCCGGGCTCGCTTGCGTTACCGCC +ERR202858.271 271 length=100 HHHHHHHHHHGDHHHHHHHHH@GHHHGGHHF@GG/C@@B?DE@FFEB@F=C><
@ERR202858.273 273 length=100 GGCCTCCCCCCGGACCAGCAGCGCCTGATCTTCGCCGGCAAGC +ERR202858.273 273 length=100 EEE/EDC9CACEB8EFBFFFF@FFFDEEFBFFBEFFF@EEDDD
@ERR202858.274 274 length=100 CAACAACATCGGCGGCAACTGGCGCGACGTGCTGTGCAAC +ERR202858.274 274 length=100 FFFFFFFFFFDFF@BD<D:A?C:A@B>1D?8<><@EEAB@
@ERR202858.275 275 length=100 CTCAGGTGCCCGGCGCGGGGCCAGGAGGGCCAGCTCTTCAGCAAGGTCTGGAA +ERR202858.275 275 length=100awk: cmd. line:1: (FILENAME=ERR202858_1.trimmed.fq.fastq FNR=884) fatal: not enough arguments to satisfy format string
` GGGFGFBGGDEGFEF3@B?;4D?ED79%*&???@AECBFFEC@C.C??;:B?='
^ ran out for this one
另一个文件出现此错误:
@ERR202858.5 5 length=100 CGTGGGGGTATGCCATGGGTATTGCAGGGTAGGCCGATTCGAACCGCGGGTTTTTGTGTTTCCATGCACGGACCTCAGCATTAAAC + DIAFGE2E@EFEF@D@A6/>=5>><C=D+B588.8;..;:11-71B=@+30-0675*7**0357-)))).<5..:.2,-79-532>
@ERR202858.6 6 length=100 CCATTGGCGGTGGCGACGATGCCTTTAACAACTTCTTCTCGGAGACCGGCTCCGGGAA + @B==@8;C88-257>69..>8:737(61>6)-8@.>-<<<()00'8-,9-)'(87)3?
@ERR202858.7 7 length=100 CGGTGGCGGTCTTGATGATCTGGATGGACGAGGGGCGCACGCGGCGGCGCGCGGCCATCTCCTGGTGGCTCGGGTGGACGTGAGCTGT +awk: cmd. line:1: (FILENAME=ERR202858_2.trimmed.fq.fastq FNR=24) fatal: no `$' supplied for positional field width or precision
这是为什么?该脚本曾用于其他文件...
答案 0 :(得分:0)
您需要为printf
指定格式字符串。 https://www.gnu.org/software/gawk/manual/html_node/Basic-Printf.html#Basic-Printf
赞printf "%s", "\n"$0
。