How to replace tabs with spaces using sed...sed -i 's/[--TAB--]/ /g' file.txt
In place of --TAB--
, give CTRL + V
followed by TAB
.
This command will replace all tabs with 3 spaces in the file file.txt
.
Tags: unix shell tips
Monday, December 22, 2008Replace Tab using SedHow to replace tabs with spaces using sed... Tags: unix shell tips
Posted by
atoztoa
at
4:50 PM
Labels: CLI, Shell, Tips n Tricks, Unix
Subscribe to:
Post Comments (Atom)
|
About MeTip of the Day
Topic: Corrupted NTFS Partition
For fixing a corrupt NTFS Partition: Run: chkdsk /F <DRIVE> And restart Windows twice. ![]() Popular Posts![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Link Exchange
designer clothes Shop online for a wide selection of fashion boutiques offering an exciting range of designer clothes and fashion accessories at low internet prices and fast home delivery service - internetboutique.net
------------------------- Buy discount contacts online at 1-800-GET-LENS. We carry all major brands of discount contact lenses. With a Huge inventory of contact lens in stock & great customer service we have the contact lenses you need for less. ------------------------- Lens.com offers a huge online inventory of brand name contacts with reasonably priced prices. Services include online order and shipping straight to you. ------------------------- Find the contacts you need at a discount price from Just Lenses. contact lens for less right to your door. ------------------------- Contacts America holds a gallery of latest branded contact lenses with facility of shopping online for the prescription lenses too. ------------------------- Buy discount contact lenses online at euroLens.co.uk. We carry all major brands as well as hard-to-find specialty contact lens. Over 1 million lenses in stock. ------------------------- order contact lenses online ------------------------- disposable contact lens ------------------------- contacts lense ------------------------- disposable contact lens ------------------------- order contact lenses online ------------------------- contacts lense ------------------------- order contact lenses online ------------------------- disposable contact lens ------------------------- contacts lense ------------------------- order contact lenses online ------------------------- contacts lense ------------------------- order contact lenses online ------------------------- disposable contact lens ------------------------- reading glasses frame ------------------------- reading glasses frame ------------------------- order contact lenses online ------------------------- contact lenses for halloween ------------------------- contacts lense ------------------------- order contact lenses online ------------------------ disposable contact lens ------------------------- hard gas permeable contact lenses ------------------------- contacts lense ------------------------- soft contact lenses ------------------------- condos in chicago ------------------------- condos in chicago ![]() Useful Links |
7 comments:
The tab can be generated by the following also.
Ctrl + V and then Ctrl + I
http://unstableme.blogspot.com/search/label/Sed
Hi Jadu,
Any ways to replace Newline character?
a’tu’tua,
I have a post on removing newlines using sed, awk, tr.
http://unstableme.blogspot.com/2008/05/remove-or-replace-newlines-using.html
// Jadu
@Jadu
Great work... :)
No need for escaping stuff, you can just put:
sed -i 's/\t/ /g' file.txt
@kotnik No you can't, this will just search for the letter "t".
sed -r 's/[[:blank:]]/ /g'
This will replace spaces and tabs, with spaces.
More bracket expressions: http://www.regular-expressions.info/posixbrackets.html
Post a Comment