I am trying to remove some junk and substitute words with the key digits, starting with strings like:
>ref|NC_035781.1| >ref|NC_035782.1| >ref|NC_035783.1| >ref|NC_035784.1|
and wanting to end with:
>NC_035781.1 >NC_035782.1 >NC_035783.1 >NC_035784.1
sed 's/\>ref\|NC_03578\([0-9]\)\.1\|/>NC_03578\1\.1/g' chr.test | grep '>NC_'
to test it and got back many more results than expected looking like:
>NC_03578.1>>NC_03578.1r>NC_03578.1e>NC_03578.1f>NC_03578.1|>NC_035780.1|>NC_03578.1 >NC_03578.1C>NC_03578.1r>NC_03578.1a>NC_03578.1s>NC_03578.1s>NC_03578.1o>NC_03578.1s>NC_03578.1t>NC_03578.1r>NC_03578.1e>NC_03578.1a>NC_03578.1 ...
What am I doing wrong?