Originally Posted by caponewgp
Is there anyway to delete certain paragraphs within a text file and then insert the paragraph into another text file.
I just cannot figure out how to remove the specific lines from the file and then insert them into another file at a certain line within that new file. Thanks again
If this is homework, please say so. I ask because people for whom this is not homework know how to do this.
Here is pseudo-code to accomplish the goal:
1. Create two new empty files, REJECT and ACCEPT.
2. Read lines from the DATA file and test for the presence of certain text patterns.
3. For lines that contain the desired pattern, copy them into ACCEPT.
4. For lines that do not contain the desired pattern, copy them into REJECT.
5. When the DATA file has been completely read, copy file REJECT over file DATA.