Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

HTML Table to CSV in AWK (See related posts)

Here's a simple AWK script to try to parse an HTML table into a comma seperated file
from http://euri.ca/blog/category/awk/

   1  
   2  BEGIN {s=""; FS="n"}
   3  /<td/ { gsub(/<[^>]*>/, ""); s=(s ", " $1);}
   4  /<tr|<TR/ { print s; s="" }



And then you execute it (on windows) as: gawk -f 1.awk *.jsp > whatever.csv

You need to create an account or log in to post comments to this site.


Click here to browse all 5556 code snippets

Related Posts