EN
Bash - remove new line characters from file with tr command
9 points
Using Bash console it is possible to remove newline characters in the following ways.
Quick solution:
xxxxxxxxxx
1
tr -d '\r\n|\n\r|\n|\r' < input_file.txt > output_file.txt
xxxxxxxxxx
1
tr -d '\r\n' < input_file.txt > output_file.txt
or:
xxxxxxxxxx
1
cat input_file.txt | tr -d '\r\n' > output_file.txt
xxxxxxxxxx
1
tr -d '\n' < input_file.txt > output_file.txt
or:
xxxxxxxxxx
1
cat input_file.txt | tr -d '\n' > output_file.txt