Reputation: 5059
I have a file like this
chr1:752426-753176_NR_015368_LOC643837 chr1:752515-753265_NR_024321_NCRNA00115
Where separation is with a tab, it has n number of columns and n number of rows.
What I want to do is to have one single column of my whole data. like this
chr1:752426-753176_NR_015368_LOC643837
chr1:752515-753265_NR_024321_NCRNA00115
Is there any one-liner in shell or Perl that can help me achieve this?
Thank you in advance.
Upvotes: 1
Views: 54
Reputation: 37136
Yes, it is possible.
-a
flag to split @F
on columnsprint
or say
each element of @F
Use >
to redirect output to a new file or use the -i
flag to enable in-place editing.
$ perl -anE 'say for @F' input.txt > output.txt
Upvotes: 1