Re: shell script to parse html and date comp ?

[email protected]
Newsgroups gmane.org.user-groups.slug.general
Message-ID <[email protected]>
On Thu, February 13, 2014 11:55 am, Rick Welykochy wrote:

>> <tr><td colspan="1" rowspan="1">Start Date Time: </td><td colspan="1"
>> rowspan="1">20/03/2014 1400 Thursday</td></tr>
>>
>> is 'grep -o' the way to go ? what regex do I need where I put ???? ?
>>
>> grep -o '<tr><td colspan="1" rowspan="1">Start Date Time: </td><td
>> colspan="1" rowspan="1">????</td></tr>'
> I would recommend egrep and use the following extended regular
> expression:
>
>
> egrep -o '[0-9]{2}/[0-9]{2}/[0-9]{4}[[:space:]][0-9]{4}'

Rick, thanks
that works well, the other item I need to grab is 'Duration', which can be
2 or 3 digits as below;
is there a way to have egrep get such 2 or 3 digits ?

<tr><td colspan="1" rowspan="1">Duration: </td><td colspan="1"
rowspan="1">60</td></tr>
or
...<td colspan="1" rowspan="1">120</td>...



-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.