I would like to move the first string between >
and the first _
to the second position after the first _
This is to transform this:
>10E13JB10_Vacares_8__a1
blablabla
>10E13JB10_Vacares_8__a2
blablabla
>10E2JB10_Mulhacen_13__a1
blablabla
Into this:
>Vacares_10E13JB10_8__a1
blablabla
>Vacares_10E13JB10_8__a2
blablabla
>Mulhacen_10E2JB10_13__a1
blablabla
-i
(for in place editing) is a GNU extension, not standard Sed. But this is still a good answer. Also see How to achieve portability with sed -i (in-place editing)? – Wildcard Nov 05 '16 at 02:44