Hi everyone I have a fasta file like below.
>miR156a
GACAGAA
>miR156b
GACAGAA
>miR156c
GACAGAA
............
I need to format it as below.
miR156a GACAGAA
miR156b GACAGAA
miR156c GACAGAA
............
Firstly i replace all new line with tab, and then replace > with new line. In the first step, I used the command sed -e 's/\n/\t/g' IN > OUT
. It didn't work. I tried an alternative perl command cat IN | perl -ne 's/\n/\t/' > OUT
. This time OUT file contains nothing. What's my problem? Thank you very much for your answers!
Following my question, i tried new perl command
cat IN | perl -ne 'while (<>) {chomp; print "$_\t"}' > OUT
and get the following output.Probably mixed use of WINDOWS and LINUX. Could anyone give me some suggestions and comments? Thanks a lot!
looks like your input file comes from windows and you are on *NIX machine. try running it through dos2unix first e.g. cat IN | dos2unix | perl ...