0
With sed I can extract data from an HTML file? For example like this:
<html>
...
<table>
<tr>
<td>R1A</td><td>R1B</td>
<td>R1C</td><td>R1D</td>
</tr>
<tr>
<td>R2X</td><td>R2Y</td>
<td>R2W</td><td>R2Z</td>
</tr>
</table>
....
</html>
Extract this output:
R1A R1B R1C R1D
R2X R2Y R2W R2Z
In my text editor I use the following regular expression:
/<tr>.*?<td>(.*?)</td>.*?<td>(.*?)</td>.*?<td>(.*?)</td>.*?<td>(.*?)</td>.*?</tr>/s
3This is not a do my work for me site. I could solve this easily but you haven't even bothered to make a polite question out of it. – Nifle – 2010-03-07T14:46:08.583
1
This way madness lies: http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454
– Paused until further notice. – 2010-03-07T15:00:30.937Politeness helps – fpmurphy – 2010-03-07T15:10:08.213
@Nifle: I understand. I was too direct. Sorry. – Sebtm – 2010-03-07T15:45:11.250
No need to all pile onto a new user. Politeness from old users helps, too. – JRobert – 2010-03-08T00:10:20.087