PROTECTED]
Sent: Monday, November 08, 2004 8:24 PM
To: [EMAIL PROTECTED]
Subject: how to append test to file
Hi ,
there is an existing file and I need to append text to it ,only thing
is I need to remove the last line of existing file and then need to
append text. I hope I am clear.If
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 09, 2004 2:31 PM
To: [EMAIL PROTECTED]
Subject: RE: how to append test to file
Hi ,
Can any suggest some thing for my problem, like I need to append to a
file from last but one line of the existing file.
Ex
Hi ,
there is an existing file and I need to append text to it ,only thing
is I need to remove the last line of existing file and then need to
append text.
I hope I am clear.If there are 6 lines in a file I have remove 6th line
and then need to append the text.
Thanks in advance
Arjun
[EMAIL PROTECTED] wrote:
Hi ,
there is an existing file and I need to append text to it ,only thing
is I need to remove the last line of existing file and then need to
append text.
I hope I am clear.If there are 6 lines in a file I have remove 6th
line
and then need to append the
Hi,
Store all the contents of the file in an array and operate on the array.
There should be a better way(inline modification i guess using -i option).
#!/usr/bin/perl -w
use strict;
my @arr;
my $filename = testtest;
open(FH,,$filename) || die Could not open $filename\n;
@arr=FH;
$arr[$#arr] = Put