@@ -0,0 +1,1261 @@
+package myProject;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.FileReader;%0Aimport java.util.Iterator;%0Aimport java.util.Map;%0Aimport java.util.TreeMap;%0A%0A%0Apublic class CountSubdomains %7B%0A%09%0A%09public static void main(String args%5B%5D)%0A%09%7B%0A%09%09TreeMap%3CString, Integer%3E map = new TreeMap%3CString, Integer%3E();%0A%09%09int count = 0, totalURLs = 0;%0A%09%09while(count++%3C99) %7B%0A%09%09try %7B%09%0A%09%09String filename = %22D:%5C%5Ccrawlstorage%5C%5Cdatafile%22 + Integer.toString(count+1)  + %22.xml%22;  %0A%09%09String str = null;%0A%09%09BufferedReader br = new BufferedReader(new FileReader(filename));%0A%09%09%0A%09%09while((str=br.readLine())!=null)%0A%09%09%0A%09%09%7B%0A%09%09%09if(str.startsWith(%22%3CsubDomain%3E%22))%0A%09%09%09%7B%0A%09%09%09%09String subdomain = str.substring(11, str.length()-12);%0A%09%09%09%09%0A%09%09%09%09subdomain = subdomain.trim();%0A%09%09%09%09if(subdomain.length()%3E2) %0A%09%09%09%09%7B%0A%09%09%09%09if(map.containsKey(subdomain))%0A%09%09%09%09%09map.put(subdomain, map.get(subdomain) + 1);%0A%09%09%09%09else%0A%09%09%09%09%09map.put(subdomain, 1);%0A%09%09%09%09%7D%0A%09%09%09%09%0A%09%09%09%7D%0A%09%09%0A%09%09%7D%0A%09%09%0A%09%7D%0A%09catch(Exception e) %0A%09%7B e.printStackTrace(); %7D%09%0A%09%09%0A%09%7D%0A%09%09%0A%09Iterator itr = map.entrySet().iterator();%0A%09%09%0A%09while(itr.hasNext())%0A%09%09%7B%0A%09%09%09Map.Entry pair = (Map.Entry)itr.next();%0A%09%09%09totalURLs  =  totalURLs + (Integer)pair.getValue();%0A%09%09%09System.out.println(pair.getKey() +%22  %22 +pair.getValue());%0A%09    %7D%0A%09%09System.out.println(%22Total URLs - %22 + totalURLs);%0A%09%7D%0A%0A%7D%0A

Create CountSubdomains.java