caution: the following code does an in-place edit. make sure to back up ( well, the -i.bak does it for you, but it can't hurt to be careful )
perl -i.bak -pe 's/^[^s].*\z//' fileIn reply to Re: Wish to keep only those lines which start with letter s, and delete all other lines.
by lestrrat
in thread Wish to keep only those lines which start with letter s, and delete all other lines.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |