Using sed or awk, I need to display text between two words/characters. Below are two example inputs and the desired output. In a nutshell, I need the date-range value between the quotes (but only the first occurance of date-range as there can be more than one).
Example One Input:
xml-report <test title="ABC" date-range="1070101" table="test" />
Desired Output: 1070101
Example Input Two:
xml-report <test title="ABC" something="here" date-range="106010172" table="test"/><subtest title="123" date-range="1080101"/>
Desired output: 106010172 (e.g. the first date-range occurance)
I've tried numerous awk/sed command and came close. I'm running CentOS 4.4 with sed --version = 4.1.2 and awk --version = 3.1.3.
Thanks,
Cam