An interesting approach, Aaron.
Most folks here would make OP show the current code set, to ensure they understood the whole read file/write file process, and that all they were stuck on were particulars of the logic.
You kind of took an interesting middle ground and fed him a complete-from-scratch working example, but he had to at least show enough cleverness to adapt it to his needs.
Not sure it's the middle ground I would have chosen, but it is a creative way to not do absolutely everything for the student.
|Replies are listed 'Best First'.|
Re^3: how to insert new line in text file after regex match?
by aaron_baugher (Curate) on May 21, 2015 at 17:55 UTC