-3
Hey there, guys. I need some help solving a cucumber quickly. At work I have a file that has 18 characters per line (more than 600 lines). I need to read each line and in each line read 6 characters at a time. And in these 6 characters I want to count how many times it repeats in this file. Ex: ABCDEF - 4, ABDEDF - 1, AAAAAA - 10... I was researching that Python could be my solution (if someone has a silver bullet with other language is welcome). Sorry I don’t master programming to already leave something I started. But I saw that I can use something like this (Python):
from collections import Counter
with open('arq.txt') as f:
ocorrencias = Counter(f.read().split())
print(ocorrencias)
Have you tried using Slices strings? Research on this, maybe it will help you. :)
– Luiz Felipe
I would have to do a for getting the interactor and interactor + 6 as indexers?
– Carlos_2021
https://repl.it/@hkotsubo/Frequentstimulatinglocatorprogram#main.py
– hkotsubo