Have a look at this mostly psuedo-code. Similar to what NV suggested, but you don't check each character 52 times :p Look up the documentation to hash maps and look at some examples if you're still confused. This one is pretty cut and dry.
Note, this will include upper and lower cases. If you wanted just characters in general, just convert all the characters to one case e.g. using toLower() or toUpper() before checking the values in the hashmap.
EDIT: Got ninja'd while posting. Basically it's like shuffle said, but it's got a bit of Java for you. Haven't programmed in that language for years, but you'll get the idea.
Code:
Mapz = new HashMap();
For loop to iterate over ever character you want to check - Grab one at a time (let's call it Character)
If Character is a letter (use isLetter()) AND Character already exists in the HashMap (use containsKey()) - Then
Some Integer = Mapz(Character); //Grab current value from hashmap
Some Integer++;
Mapz.put(Character, Some Integer); //Replace old value from hashmap with updated value
Else If Character is a letter AND Character does NOT already exist in Hashmap - Then
Mapz.put(Character, new Integer(1)); //Add new entry into hashmap, value of 1 since it's first time we encountered the letter
End For loop
Write HashMap to CSV file
Note, this will include upper and lower cases. If you wanted just characters in general, just convert all the characters to one case e.g. using toLower() or toUpper() before checking the values in the hashmap.
EDIT: Got ninja'd while posting. Basically it's like shuffle said, but it's got a bit of Java for you. Haven't programmed in that language for years, but you'll get the idea.