Your questions about running multiple sed appear to have been answered, but sed is the wrong tool for this. Assuming the input format is rigid, and is always at the start of a line and the td tags you are looking for are always preceded by exactly 2 spaces on the line (this solution can easily be modified if that is not the case), you can do:
awk -F'?td>' '/^
The first argument tells awk to split each line on either or
|
, so the data you are interested in becomes the 2nd field. The first clause of the 2nd argument resets the counter i to zero whenever appears at the start of a line. The next increments i
each time appears after 2 spaces. The last prints the 2nd field for the 2nd line. And the last argument specifies your input file.
Of course, that gives you everything between the tags, which I see is not what you want. To just get the chunk of text between and the first whitespace, try:
awk '/^", ""); print $1}' input-file
|
|
|
|