in reply to Count number of unique tags in XML files
Almost uniquely with XML this is a case where a regex would also work:
perl -n -e 'while(s/<([\w\d\:]+)//){$f{$1}++;}\ END{print map "$_\n", sort keys %f;\ print "There are ", scalar(keys %f), " tags in the files\n"} * +.xml
Assuming well formed XML of course
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Count number of unique tags in XML files
by mirod (Canon) on Apr 09, 2004 at 17:15 UTC |