my input:
ads bdsd cds dds
ac cv ss ds
dsd
output I expect:
ads
bdsd
cds
dds
ac
cv
ss
ds
dsd
command I used:
cat file1.txt | perl -p -i -e 's/\n(.+)/$1/'
but it does not work
my input:
ads bdsd cds dds
ac cv ss ds
dsd
output I expect:
ads
bdsd
cds
dds
ac
cv
ss
ds
dsd
command I used:
cat file1.txt | perl -p -i -e 's/\n(.+)/$1/'
but it does not work
Try this:
cat file1.txt | tr -s " " "\n"
Basically, it replaces spaces with newlines and removes empty lines.