So on the command line in linux I am trying to search some HTML code and print just a dynamic part of the code. For example this code
<p><span class="RightSideLinks">Tel: 090 97543</span></p>
I would just want to print 97543 not the 090. The next time I search the file the code might have changed to
<p><span class="RightSideLinks">Tel: 081 82827</span></p>
And I just want the 82827. The rest of the code stays the same just the phone numbers change.
Can I use grep to do this?
Thanks
Edit:
Would it be possible to use it on this code too?
<tr class="patFuncEntry"><td align="left" class="patFuncMark"><input type="checkbox" name="renew0" id="renew0" value="i1061700" /></td><td align="left" class="patFuncTitle"><label for="renew0"><a href="/record=p1234567~S0"> I just want to print this part. </a></label>
What changes on that is the record number: p1234567~S0" and the text that I want to print.
One way using
GNU grep:Example contents of
file.txt:Results:
EDIT: