Find the answer to your Linux question:
Results 1 to 2 of 2
Can any body tell me whether there is any command in bash shell that removes new line(i.e"\n") from a file.......i.e a complete file should be a single line........is there any ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2007
    Posts
    15

    Question Shell command to remove new line markers from file


    Can any body tell me whether there is any command in bash shell that removes new line(i.e"\n") from a file.......i.e a complete file should be a single line........is there any bash shell command to do this job.

  2. #2
    Linux User
    Join Date
    Aug 2006
    Posts
    458
    one method
    Code:
    tr -d '\012'  < file > newfile

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •