Error with Text reformatting (awk)

I got this error when running the awk program for Text Reformatting:

awk: /data/jwd/main/039/277/39277152/configs/tmp23311chz:1: NR>1{\nif ($3 < $4) {\n print $1,$3,$4,\"clip_peak_\"NR-1,$9,$5;\n}\nelse {\n print $1,$4,$3,\"clip_peak_\"NR-1,$9,$5;\n}\n}
awk: /data/jwd/main/039/277/39277152/configs/tmp23311chz:1:      ^ backslash not last character on line
awk: /data/jwd/main/039/277/39277152/configs/tmp23311chz:1: NR>1{\nif ($3 < $4) {\n print $1,$3,$4,\"clip_peak_\"NR-1,$9,$5;\n}\nelse {\n print $1,$4,$3,\"clip_peak_\"NR-1,$9,$5;\n}\n}
awk: /data/jwd/main/039/277/39277152/configs/tmp23311chz:1:      ^ syntax error

How do I fix this syntax error?

Dear @biostaring,
Please remove all “\n” from the awk command; and change "“clip_peak_” to just “clip_peak_”.

It should work then.

Best wishes,
Florian

1 Like