Convert a tab-delimited file to use newlines

text processing

input.txt (around 30K lines)

RT|367079254|bn|ERTS01065811.1| 38 1 503
RT|367079251|bn|ERTS01065814.1| 56 3 502
RT|367079248|bn|ERTS01065817.1| 52 2 502

output.txt

RT|367079254|bn|ERTS01065811.1|
38
1
503
RT|367079251|bn|ERTS01065814.1|
56
3
502
RT|367079248|bn|ERTS01065817.1|
52
2
502

Best Answer

Sed:

sed -e 'y/\t/\n/' input.txt > output.txt

Awk:

awk 'BEGIN { OFS = "\n" } { $1=$1; print }' input.txt > output.txt
Related Question