I am trying to code a program so I can search up a sheep earmarks and see what their lambs earmark is (and other information on the sheep). Sorry if this is explained badly - English is not my first language.
I have a code so I can import all the earmarks number from a txt file that I created. I don't know how to search for a specific earmark number.
I will be using this for personal use as it is much easier than having to sit there with the list on paper trying to find a number
import csv
results = []
with open('sau.txt', newline='') as inputfile:
for row in csv.reader(inputfile):
results.append(row)
print(row)
Here is my txt:
Sheep nr.7024: lamb nr.8001 og 8002 Sheep nr.5072: lamb nr.8021, 8022, 8023, 8024 Sheeo nr.3051: lamb nr.8095