Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick sed ?

Status
Not open for further replies.

pmcmicha

Technical User
May 25, 2000
353
I am trying to write a sed statement that will recognize the blank space at the beginning of a line and append a letter to this blank space. This is what I have so far....

sed s/^ /B

I thought that this would work, thanks in advance.
 
Your script will replace a blank at the beginning of a line with the letter B. To append a B after 1 space at the beginning of a line use:
Code:
sed 's/^ / B/'
To apend a B after any number of spaces at the beginning of a line use:
Code:
sed 's/^\( *\)/\1B/'[code]

Hope this helps. CaKiwi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top