Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

arrange given line in a pattern [closed]

I have many files containing information about human. pattern of information in each file is:

587. JARID2 antisense RNA 1
JARID2-AS1, Homo sapiens
Hs.664092: 16 sequences.

588. Transcribed locus
Homo sapiens
Hs.569392: 11 sequences.

589. Golgin A8 family, member G
GOLGA8G, Homo sapiens
Hs.169639: 11 sequences.

but I want them to be like that(tab separated):

587. JARID2 antisense RNA 1 JARID2-AS1, Homo sapiens    Hs.664092: 16 sequences.

588. Transcribed locus  Homo sapiens    Hs.569392: 11 sequences.

589. Golgin A8 family, member G GOLGA8G, Homo sapiens   Hs.169639: 11 sequences.

so that I can put them in a xl file proper way, manual arrangement would take a lot of time.

like image 766
Ashish Pathak Avatar asked Jan 27 '26 21:01

Ashish Pathak


1 Answers

with a perl oneliner:

perl -00 -wlpe 's/\n//gms' file.txt

Or if you truly want tab separated

perl -00 -wlpe 's/\n/\t/gms' file.txt
like image 156
salparadise Avatar answered Jan 29 '26 11:01

salparadise



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!