for counter, line in enumerate(completedataset):
    print(counter + 1)
firstcomma = thestring.find(',')
havename = thestring.find(t, 0, firstcomma)
if havename >= 0:
    smallerdataset.write(line)
Confusion about string find?