ginju75 has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
I have a large input file, in which I have to comment out a few lines. It is a pain to do it manually, so I wanted to write a script to do it.
So here is what I have:
The block of line which I want to comment out start with a TAG, and end with a ");". For example:
MYTAG (
Line 1
Line 2
Line 3
);
So, the block of lines would start with a tag and end with ");" And there can be amny block of lines like these, ofcourse each with an individual starting TAG
My question is how will I read just the required lines between the TAG and the closing bracket and then just comment out those lines in the input.
Effectively, the above lines in the input text need to be changed to:
#MYTAG (
# Line 1
# Line 2
# Line 3
# );
Please provide some wisdom..
Thank you all great Monks,
A learning Monk!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to comment out lines in a text?
by zengargoyle (Deacon) on Mar 23, 2002 at 00:36 UTC | |
by jeffa (Bishop) on Mar 23, 2002 at 00:48 UTC | |
by zengargoyle (Deacon) on Mar 23, 2002 at 01:03 UTC | |
by jeffa (Bishop) on Mar 23, 2002 at 07:51 UTC | |
|
Re: How to comment out lines in a text?
by jeffenstein (Hermit) on Mar 23, 2002 at 21:43 UTC |