insert string after line number n

insert string after line number n

am 09.05.2006 21:48:51 von Jane

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

Re: insert string after line number n

am 09.05.2006 22:14:42 von Paul Lalli

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

Re: insert string after line number n

am 10.05.2006 20:34:34 von Joe Smith

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