| Author |
insert string after line number n
|
|
|
| Hello,
How can I insert string after line number n? I have to insert string
after "//StartHere".
I know I could do this in awk but I already started
with Perl. I'm not asking for specific answer but an idea
or alorithm would be good starting with which functions
I can use to start.
For example I have a file that has:
....
this is a test.
And << >> another test;
(and maybe ;; // ##);
//
//StartHere
(insert strings here)
(and here)
(and here)
(and so on)
(depending how many)
.....
Thanks.
J
| |
| Paul Lalli 2006-05-09, 6:58 pm |
| Jane wrote:
> How can I insert string after line number n?
Please read the Perl FAQ *before* asking hundreds of people around the
world to read it to you.
$ perldoc -q insert
Found in /opt2/Perl5_8_4/lib/perl5/5.8.4/pod/perlfaq5.pod
How do I change one line in a file/delete a line in a
file/insert a line in the middle of a file/append to the
beginning of a file?
Paul Lalli
| |
| Joe Smith 2006-05-10, 6:58 pm |
| Jane wrote:
> How can I insert string after line number n?
> I know I could do this in awk ...
man a2p
NAME
a2p - Awk to Perl translator
|
|
|
|