I have a file.txt that contains these lines: (the actual dates will vary, but are always in this format)
UPDATE_FILE: filename.update
TEST_DATE: Sun Aug 30 10:22:32 MDT 2020
DATE: Sun Aug 30 13:21:44 MDT 2020
I am currently using this line to parse the file and return the UPDATE_FILE name:
$ sed -n -e '/UPDATE_FILE/{s/.*: *//p}' file.txt
file.update
However, I have issues when using it on the other line, probably because I set the deliminater to a colon.
sed -n -e '/TEST_DATE/{s/.*: *//p}' file.txt
returns:
$ sed -n -e '/TEST_DATE/{s/.*: *//p}' test.txt
32 MDT 2020
How do I return the entire line following the FIRST colon following the "keyword"? Such as: (assuming the sed is correct)
$ sed -n -e '/TEST_DATE/{s/.*: *//p}' test.txt
Sun Aug 30 10:22:32 MDT 2020