In an XML file I need to remove the dashes in the < ssn > node, ###-##-#### . I can't remove all dashes from the file since other nodes, like < phone > and <federal_id> need their dashes.
I don't need to use a regular expression if there is another method that is easier.
Here is an example of the file:
<Billing>
<corrected></corrected>
<ssn> 123-12-1234 </ssn>
<addr_line3> 909-555-1234 </addr_line3>
<trayear> 2020 </trayear>
<federal_id> 95-12345123 </federal_id>
<service_provider></service_provider>
<reporting_method> X </reporting_method>
</Billing>
I can remove all dashes with a sed command: sed "s/- //g"
but I need them in some nodes still < federal_id > and < addr3_line >
question from:
https://stackoverflow.com/questions/65945232/need-to-remove-dashes-inside-an-xml-node-with-a-regular-expression 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…