Siph0n
November 5th, 2007, 02:02 AM
I have my script read in lines, and than split it with ' ' as the delimiter (if that's the right word), to make each line a list. The lines in the file are like the following:
"012345 111222333 Shawn M. McCarthy 1234"
without the quotes. So I end up with:
lineSplit[0] = 012345
lineSplit[1] = 111222333
lineSplit[2] = Shawn
lineSplit[3] = M.
lineSplit[4] = McCarthy
lineSplit[5] = 1234
However when I do lineSplit[5].isdigit() , it returns false... Any ideas? I found out that if the lines in my file were like this:
"012345 111222333 Shawn M. McCarthy 1234 "
It would work. Any idea why I need a space at the end of the line? Could it be a special \n character or something at the end of the line? Thanks for any help! :)
"012345 111222333 Shawn M. McCarthy 1234"
without the quotes. So I end up with:
lineSplit[0] = 012345
lineSplit[1] = 111222333
lineSplit[2] = Shawn
lineSplit[3] = M.
lineSplit[4] = McCarthy
lineSplit[5] = 1234
However when I do lineSplit[5].isdigit() , it returns false... Any ideas? I found out that if the lines in my file were like this:
"012345 111222333 Shawn M. McCarthy 1234 "
It would work. Any idea why I need a space at the end of the line? Could it be a special \n character or something at the end of the line? Thanks for any help! :)