Thanks for the approach. I decided to use regular expressions. I'm going by the code you posted (below). I replaced the line re.findall line with my file handle read( ) like this:
print re.findall(pattern, myFileHandle.read()) This prints out only brackets []. Is a 're.compile' perhaps necessary ? Raymond Hettinger wrote: > # Approach for more loosely formatted inputs > import re > pattern = '''(?x) > Name:\s+(\w+)\s+ > Age:\s+(\d+)\s+ > Birthday:\s+(\d+)\s+ > SocialSecurity:\s+(\d+) > ''' > print re.findall(pattern, inputData) -- http://mail.python.org/mailman/listinfo/python-list