Sooner or later, I will…
sed tricks to replace multi blank spaces and tabs with single space
Replace all multi-blankspaces (more than one spaces/tabs) in file with mono-blankspace (one space):
sed 's/[<space>][<tab>][<space>][<tab>]*/ /g' filename
can also be:
sed 's/[<space>][<tab>][<space>][<tab>]*/ /g' filename > newfilename
note: g in the end means GLOBAL
In the above samples, <space> means ‘ ‘ (empty space) and <tab> means ‘ ‘ (tab key press).
Comments are closed.
Recent Comments