I want to retrieve whatever is between these two tags  <tr> </tr>  from an html doc. Now I don't have any specific html requirements that would warrant for an html parser. I just plain need something that matches <tr> and </tr> and gets everything in between and there could be multiple trs. I tried awk, which works, but for some reason it ends up giving me duplicates of each row extracted.awk '/<TR/{p=1; s=$0}p && /<\/TR>/{print $0 FS s; s=; p=0}p' htmlfile> newfileHow to go about this?
Text between two tags
shell script;text processing;sed;awk;html
if you only want ... of all <tr>...</tr> do:grep -o '<tr>.*</tr>' HTMLFILE | sed 's/\(<tr>\|<\/tr>\)//g' > NEWFILEfor multiline do:cat HTMLFILE | tr \n | | grep -o '<tr>.*</tr>' | sed 's/\(<tr>\|<\/tr>\)//g' | sed 's/|/\n/g' > NEWFILEcheck the HTMLFILE first of the char | (not usual, but possible) and if it exists, change to one which doesn't exist.