'Brian J. Murrell' brian@interlinx.bc.ca [sed-users]
2016-03-20 15:52:33 UTC
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]
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]