Attempt 1:
import reWorked fine and brought to my attention that indentation is important in Python. I also modified the text to hit my "Nothing to do" statement which worked fine as well. Imports are simple enough which is going to become important in the next part because now I want an html / html parser and I don't want to build my own.
file_in = open ("Text-1.txt", "r")
file_in_content = file_in.read()
if (re.match("<p><br \/></p>", file_in_content)):
modified = re.sub("<p><br \/><\/p>", "<p> </p>", file_in_content)
print modified
else:
print "Nothing to do"
No comments:
Post a Comment