Thread: Reading a file
View Single Post
Old 04-30-2006, 02:31 PM   #4 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
So your psuedo code looks like this:
Code:
Open File
while there are lines to be read in file
 Store each line as a temporary String
 If string does not match '^-+$' add string to output array
Close file 
Foreach entry in output array
 print string
Now for the match I'd recommend something like re.compile('^-+$').search(tmpstr,1) Here's a link to the pydoc for re http://docs.python.org/lib/module-re.html
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote