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
In reply to Re: Count number of unique tags in XML files
by hawtin
in thread Count number of unique tags in XML files
by leriksen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |