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