[SOLVED] awk anyone?
by gregors from LinuxQuestions.org on (#5E987)
Hi there!
I want to make a news page (html with lots of pictures) more handy. Since my cat|tr|grep chain didn't lead to what I want, I think that awk might be able to do the job.
Problem is that I don't just want single lines but some combination of corresponding lines.
To make long things short: I want to look for a line with
<span class="teaser__headline">++ Japan beginnt mit Impfprogramm ++</span>
and take its (visible) text, combining it with the text from the following line that starts with
<p class="teaser__shorttext">Funf Monate ...
So I need to look for "teaser__headline", take the text from that paragraph and make it followed by the text from the line that contains "teaser__shorttext".
The result should look similar to
++ Japan beginnt mit Impfprogramm ++
Funf Monate ...
The next (?) step would be to see how things are linked with <a> tags and use them to make my result clickable ...
If there's a better forum my question please let me know. And if you don't know awk just like me: sorry to bother ...
TIA
Gregor


I want to make a news page (html with lots of pictures) more handy. Since my cat|tr|grep chain didn't lead to what I want, I think that awk might be able to do the job.
Problem is that I don't just want single lines but some combination of corresponding lines.
To make long things short: I want to look for a line with
<span class="teaser__headline">++ Japan beginnt mit Impfprogramm ++</span>
and take its (visible) text, combining it with the text from the following line that starts with
<p class="teaser__shorttext">Funf Monate ...
So I need to look for "teaser__headline", take the text from that paragraph and make it followed by the text from the line that contains "teaser__shorttext".
The result should look similar to
++ Japan beginnt mit Impfprogramm ++
Funf Monate ...
The next (?) step would be to see how things are linked with <a> tags and use them to make my result clickable ...
If there's a better forum my question please let me know. And if you don't know awk just like me: sorry to bother ...
TIA
Gregor