downloadercloudway
  • Blog
  • About
  • Contact

Sed Remove Line Feed From Text File - Free Software and Shareware

12/21/2015

0 Comments

 

Inspired by the success of my 'Awk One-Liners Explained' article (30,000 views in first three days), I decided to explain the famous sed one-liners as well.

Use sed command to delete / remove BOTH leading and trailing whitespace from each line including blank lines from a text file.

Remove ( color / special / escape / ANSI) codes, from text, with sed. Credit to the original folks who I've copied this command from. The diff here is.

Explains how to delete or remove ^M carriage return ( line feed) using sed under UNIX / Linux / BSD / Apple OS X operating systems.

You're parsing some text to extract the username from a domain\username string, most likely from Windows. Most of the above answers are only addressing your specific.

Right now I'm using echo 'Hello World' >> file.txt to append some text to a file but I also need to add text below a certain string let's say '[option]', is it.

You can either replace the backslash by a space as you show in the example result: sed 's/\\/ /g' or you can remove it as you show in your code.

0 Comments



Leave a Reply.

    Author

    Write something about yourself. No need to be fancy, just an overview.

    Archives

    January 2016
    December 2015
    November 2015

    Categories

    All

    RSS Feed

Powered by Create your own unique website with customizable templates.
  • Blog
  • About
  • Contact