| Newsgroups |
gmane.editors.sed.user |
| Message-ID |
<[email protected]> |
:a
/\*,/bb
s/[A-Za-z]/*/
ta
:b
s/^...../Name:/
What about a name like Bart J. Simpson?
Tested on sedroid
On March 20, 2016 4:52:33 PM CET, "'Brian J. Murrell' [email protected] [sed-users]" <[email protected]> wrote:
>Let's say I have a file of lines and some of the lines are of the form:
>
>
>Name: <a first name> <possibly attributions like M.D.>
>
>
>Such as:
>
>
>Name: Bart Simpson, MD
>
>
>and I want to redact the name part only with a 1:1 substitution of
>letters to asterisks so that the result is:
>
>
>Name: **** *******, MD
>
>
>So effectively I want to do a 's/[A-Za-z]/*/g' only on the portion of
>the line that comes after the ": " and before any ,.
>
>
>Is there any way to do this with sed?
>
>
>Cheers,
>b.
>
>
>
>
>[Non-text portions of this message have been removed]
>
>
>
>
>------------------------------------
>Posted by: "Brian J. Murrell" <[email protected]>
>------------------------------------
>
>--
>
>------------------------------------
>
>Yahoo Groups Links
>
>
>
--
Sent from my FAIRPHONE. Be fair, don't fox.
[Non-text portions of this message have been removed]