Extract paragraphs from text file
I have a huge text file that contains paragraphs
separated by dotted borders. Each border
is a line of stars such as: ****************
What is an efficient way to selectively extract
paragraphs and append them to a new text file?
I will only select a paragraph if it does not
contain profanity words or other select words.
For example, given this input:
------BEGIN INPUT-------
Hello. This is a short novel written
by someone.
********************
I dont give a **** who reads this.
********************
Hey, sometimes **** happens, but
you gotta keep going.
********************
The end!
********************
------END INPUT-------
The output should be:
OUTPUT FILE:
Hello. This is a short novel written
by someone.
The end!
|