I just pondered upon this problem while executing some tasks in shell.
How can I convert a .txt
file which contains text in the following format[vertical direction]:
H
e
l
l
o
W
o
r
l
d
Note: The line without any letter contains a space and EOL
I need to convert to:
Hello World
I tried the following command: cat file1.txt |tr '\n' ' ' >file2.txt
Output:
H e l l o W o r l d
How can I proceed further? Sorry, if this question has already appeared. If so, please provide me the link to the solution or any command for the work around.