I have a text file in the following format
CCCCCGCCCCCCCCCCcCCCCCCCCCCCCCCC
AAAATAAAAAAAAAAAaAAAAAAAAAAAAAAA
TGTTTTTTTTTTTTGGtTTTTTTTTTTTTTTT
TTTT-TTTTTTTTTCTtTTTTTTTTTTTTTTT
Each row/line will have 32 letters and each line will only have multiple occurrences of 2 letters out of a pool of ATGC (also small atgc). some may have also '-'. I would like to count the occurrence of each alphabet in a line and output the position number/ numbers of the smallest counted alphabet.
CCCCCGCCCCCCCCCCcCCCCCCCCCCCCCCC G 7
AAAATAAAAAAAAAAAaAAAAAAAAAAAAAAA T 5
TGTTTTTTTTTTTTGGtTTTTTTTTTTTTTTT G 2 15 16
TTTT-TTTTTTTTTCTtTTTTTTTTTTTTTTT C 15
Please let me know the best way to do it using awk.
Thanks