I need to replace all the fragments: 5.6xx and 5.5xx (where x is 0-9 digits) in a text file with 5.500, but only when the line containing the match begins with the line (for example, STARTSTRING). It means
STARTSTRING 5.610 4.500 3.550 5.530
OTHERSTRING 5.600 5.500 5.500 5.600
should become
STARTSTRING 5.500 4.500 3.550 5.500
OTHERSTRING 5.600 5.500 5.500 5.600
I am not sure how I can do this. I use sed for editing.
Thank you so much!:)
PS: If necessary, I run the latest version of debian.
source
share