I have a string of letters ‘aaabbbcccdddeeefffggg‘ that i would like to read as 3 letter words. For example, 'aaa','bbb','ccc'...
Is there any code that you know of that can do this function?
My ultimate goal is to assign numbers to each word like
aaa= 123
bbb= 234
ccc= 356 ...
and have the output be the position of the word in the sentence with that value
so for the sentence of ‘aaabbbcccdddeeefffggg‘
the three letter words would be 'aaa','bbb','ccc'...
aaa would be the 1st position (1), bbb would be the 2nd position (2), ccc would be the 3rd position (3)
so ultimately i would get
(1,123),(2,234),(3,356) for 'aaa','bbb','ccc'
i have been trying this for a few hours and i cannot figure out how to do this so any help would be much appreciated
thanks
1 Answer