replace all characters in only a portion of a line
"'Brian J. Murrell' [email protected] [sed-users]" <[email protected]> Sun, 20 Mar 2016 11:52:33 -0400
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <[email protected]> |
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]