LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Curl and trying to evaluate output i get back (https://www.linuxquestions.org/questions/linux-newbie-8/curl-and-trying-to-evaluate-output-i-get-back-692462/)

helptonewbie 12-23-2008 07:29 AM

Curl and trying to evaluate output i get back
 
Hi All,
I'm trying to do something with output i get back with curl. What i'd love to be able to do specifically is capture all parts of output that are between <td> </td> tags in html.

For Example:-
Curl output....

<tr><td>1</td><td>2</td></tr><tr><td>3</td><td>4</td></tr><tr><td>5</td><td>6</td></tr>

Or something similar and then i'd love to somehow, return back...
1
2
3
4
5
6

OR

1|2|3|4|5|6

Just some sort of delimiter or something, not sure how to do this or even what command is best... probably some complicated awk or sed.

Any ideas?
Cheers,
MJ

helptonewbie 12-23-2008 08:17 AM

HI All,
I've got pretty much there i think, but if there is a better way than..
Code:

sed -n '/^$/!{s/<[^>]*>/\n/g;p;}'
Please let me know
Cheers


All times are GMT -5. The time now is 01:34 AM.