I've made a program that's looking through social security numbers and putting them into a textfile either as I wrote them into the program (if the number was valid). or with a comment like the number is too long if the number is too long.

Now i want to be able to "call for them" separatly but i have no idea how to separate the valid numbers from the invalid ones in my textfile.

```
def showALLnumbers():
    print ("all numbers:")
    textfile = open("textfile.txt", "r")
    data = textfile.read()
    print (data)
    textfile.close

```

This is how I call for them all but how do I get just the ones with comments like below, and how do I get the ones without these kind of comments?

```
if socialsecuritynumber.isdigit()== False:
    print (number, "\t", "not only digits")
    textfile.write("\n" + socialsecuritynumber + "\t" + "not only digits" )
    return False

```

Sorry for messy text but would appreciate help!

EDIT - this is how it looks in the text file

1. 1992051155700 too many digits
2. 9205115570
3. 92051155700
4. 199205115570 incorrect form
thats how the textfile looks but without the 1, 2 ,3 ,4