Perl error

  cat "C:\Program Files\BioDiscovery\Nexus 7\Organisms\Human\NCBI Build 37\refseq_genes.txt" |  perl -aF/\\t/ -lne '$F[2]=~/_/ and next; @st=split/\,/,$F[9];@en=split/\,/,$F[10];print join("\t",$F[2],$st[$_],$en[$_],$F[0]) for (0..$#st)' | sort -u > refseq_exons.bed 

sort: open failed: -u: No such file or directory

Not sure how to fix the error. Thanks :).

replace sort -u with sort -u

How is the second sort -u different. The changed worked I am just trying to learn. Thank you.

The `-' is not the same that `-'

1 Like

Thank you :).

One of those must be some fancy unicode dash or something from a word processing program, not an ASCII dash.

So, never ever use a word processor to make a script file :wink:

Honest mistake though -- I needed a hex dump to tell the difference at all. One is a 1-byte ASCII character. One is a 3-byte UTF-8 thing. (The 0a is a newline.)

$ echo '�' | hexdump -C
00000000  e2 80 93 0a                                       |....|
00000004
$ echo '-' | hexdump -C
00000000  2d 0a                                             |-.|
00000002
$
1 Like

Thank you very much :).