public static void main(String[] args) throws Exception {
		
		BufferedReader br = new BufferedReader(new FileReader(new File(
				"D:\\Twitter Files\\MasterTweetsFile.txt")));
		
		BufferedWriter bw=new BufferedWriter(new FileWriter(new File("D:\\Twitter Files\\HighestTweets.txt")));
		
		Map<String, Integer> highestTweets=new HashMap<String,Integer>();
		
		//text+"|"+retweet_count+"|"+exactTime[3]+"|"+followers_count+"|"+friends_count+"|"+name+"|"+lang+"\n";
		//  0          1                2                    3                   4           5         6    
		String str=null;
		try{
		while((str=br.readLine())!=null){
			
			
			if(str==" ")
				continue;
			if(str.equals("||"))
				continue;
			String newStr[]=str.split("\\|");
			if(newStr.length>6&&newStr[5].length()>3)
			if(highestTweets.containsKey(newStr[5]))
				highestTweets.put(newStr[5], highestTweets.get(newStr[5])+1);
			else
				highestTweets.put(newStr[5], 1);
			
		}
		int count=0;
		Map<String,Integer> sortedHighestTweets=sortByValues(highestTweets);
		for (Entry<String, Integer> entry : sortedHighestTweets.entrySet()) {
			
			if(count<50){
			bw.write(entry.getKey()+" "+entry.getValue()+"\n");
			count++;
			}
			else{
				break;
			}
			
		}
		}
		catch(Exception e){
			e.printStackTrace();
		}
		finally{
			bw.close();br.close();
		}
		
		
	}