<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html LANG="ES">
<head>
<body>
a lot of varying html
<hr>
<table border="0" cellpadding="0" cellspacing="0" align="right" summary="just a navigational helper">
<tr>a few lines of not changing table cells and rows
</tr>
</table>
</body>
</html>
into
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html LANG="ES">
<head>
<body>
a lot of varying html
</body>
</html>
write="1"
while read linea
do
if [ "$linea_ant" = "<hr>" ] && [ "$linea" = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"right\" summary=\"just a navigational helper\">" ]
then
write="0"
else
if [ "$linea_ant" = "</table>" ]
then
write="-1"
fi
fi
if [ "$write" = "1" ]
then
echo $linea_ant
fi
if [ "$write" = "-1" ]
then
write="1"
fi
linea_ant="$linea"
done < html1
if [ "$write" = "1" ]
then
echo $linea_ant
fi
is not very 'general' but you can modify it if you have "spaces" at the beginning of the line. Mind if there is another table inside the table you want to drop this basic script doesn't run...
thanks for the posts - just to remind you that the html block contains a lot of html, tables, lines, etc. so all suggestions deleting "after tr" or deleting just a table are not productive
And the table I want to delete slightly alters now and then. Now I don't mind changing the table input here and there, but unescaping all characters, lines etc, is a bit too complicated if you have to do it thirty times. Thats why I asked about an input file....