I have this two types of outputs:
UID:474D229F698D494E889D85CEF9303B97:480 f
UID:474D229F698D494E889D85CEF9303B97:480
I want to get the 32 char long uid with the 480 at the end of it. (Note that there is nothing after 480 for the second type of input) Desired output:
474D229F698D494E889D85CEF9303B97:480
474D229F698D494E889D85CEF9303B97:480
I am using sed:
cat input.txt | sed 's!UID:\(.*\):\([0-9]*\)[\s]*!Captured:\1:\2!'
but the output is:
Captured:474D229F698D494E889D85CEF9303B97:480 f
Captured:474D229F698D494E889D85CEF9303B97:480