In the txt file it is composed of the following writing:
funded_txo_count:0 funded_txo_count:0 funded_txo_count:5
I use this code to count number of specific string or character example, if I have "0" 1000 times, the output if 1000,
But what do I have to do to identify the different lines that do not contain this string or character? I mean the number of the line itself, since the txt file that I want to identify is based on each line
d = 0
with open("filename.txt", "r") as in_file:
for line in in_file:
d += line.count("0")
print(d)
Output: 2
I want to identify the other lines that do not contain the character or string 0
Identifying different characters according to the line.
Add some code to keep track of the current line number. Also when you call
count(), add a bit of extra processing if it did not find anything: