Question: I need to modify all files that has a ".txt" extension within a directory in the following way:

remove all text lines beginning with the line that starts with "xxx" and the line that ends with "xxx", inclusive.

I know how to do this in Java or C++, but can someone show me a simple script that can get this done?

Thanks!

Answer: 
I assume that you want to lose start and end, and those words appear by themselves on the lines you want lost.

```
perl -ni.bak -e 'print unless /^start$/../^end$/' *.txt

```

Note that I made a backup of the modified files so that you can inspect the change and fix it if you want.
```
ruby -i.bak -ne 'print unless /^start/.../^end/' *.txt

```