1
I have many files which I want to delete all the lines except the lines that have certain words. I tried to do it with TextWrangler: Text > Process Lines Containing… But only does it word by word. I am on OS X. I would appreciate your help. Thank you
My files are like these: (other files have more lines)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<movie>
<title>Robotron</title>
<originaltitle></originaltitle>
<id></id>
<mpaa></mpaa>
<actor>
<name></name>
<thumb> .jpg</thumb>
<name></name>
<thumb> .jpg</thumb>
</actor>
<genre>Action</genre>
<genre>Drama</genre>
</movie>
I want to delete all the lines except the lines that have the words: xml, movie, title, id, actor, name and genre; and copy them to a new file. Is this possible?
Desired result in new file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<movie>
<title>Robotron</title>
<id>Robotron</id>
<actor>
<name></name>
<name></name>
</actor>
<genre>Action</genre>
<genre>Drama</genre>
</movie>