Top community members
All Wiki Articles Create Wiki Article

Welcome to Dirask IT community! ❤ 💻
We are community that shares solutions with each other.

If you think you have something to add here.

you are welcome with your fresh ideas - List Articles

Bash - remove new line characters from file with tr command

0 contributions
6 points

Using Bash console it is possible to remove new line characters in following ways.

1. CRLF removing examples

1.1. File streams redirection

$ tr -d '\r\n' < input_file.txt > output_file.txt

1.2. Application streams redirection

$ cat input_file.txt | tr -d '\r\n' > output_file.txt

2. LF removing example

1.1. File streams redirection

$ tr -d '\n' < input_file.txt > output_file.txt

2.2. Application streams redirection

$ cat input_file.txt | tr -d '\n' > output_file.txt

 

0 contributions

Checkout latest Findings & News:

Checkout latest questions:

Checkout latest wiki articles:

Hey 👋
Would you like to know what we do?
  • Dirask is IT community, where we share coding knowledge and help each other to solve coding problems.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.
Read more