2 more comments: - the script I sent assumes that neither <span> not </span> appears in comments or in string literals, see also my first response and Tsafrir's post; - tip: assuming the script is in "span.awk" you may find the following command helpful - $ diff -u file.html <(span.awk file.html) -- Oleg Goldshmidt | pub at goldshmidt.org