|
Re: awk script help
It will be in the form of:
awk '/.html/ {HTML=HTML+1}
/.htm/ {HTM=HTM+1}
/.doc/ {DOC=DOC+1}
END {
printf("HTML=%s; HTM=%s; DOC=%s\n", HTML, HTM, DOC);}'
It might be better to use perl. Perl has a lot of libraries that know about correct syntax html files. The libraries can parse the document and return various pieces of it.
The code snipit above came from a shell script call "dvddup.sh". Go and google for it. It has a lot of awk in it. Also go to the directory "/usr/bin" and "grep awk *". There are a lot of files distributed with my Fedora Core 8 that have awk scripts in them.
Hope this helps.
|