I have to replace all ocurrences of: 5.6xx and 5.5xx (where x is a 0-9 digit) on a textfile with 5.500, but only when the line that contains the match starts with a string (e.g. STARTSTRING). That 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 can I do this. I am using sed for the editing.
Thanks a lot! :)
PS: If necessary, I am running the latest debian version.