Sections

Main/Advocacy




Main
Recent Changes Printable View Page History RSS Feed Edit Page

Using the stream editing program sed

 sed 's/.$//'               # assumes that all lines end with CR/LF
 sed 's/^M$//'              # in bash/tcsh, press Ctrl-V then Ctrl-M
 sed 's/\x0D$//'            # gsed 3.02.80, but top script is easier

Here's another useful one

 # delete leading whitespace (spaces, tabs) from front of each line

 sed 's/^[ \t]*//'             # aligns all text flush left

A basic one

 sed 's/foo/bar/g' filename 

Page last modified on June 09, 2004, at 09:44 AM