RE: how to append test to file

2004-11-09 Thread arjun.mallik
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: if a file has 6 lines then appending should be done from 6th line Thanks in advance Arjun -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

RE: how to append test to file

2004-11-09 Thread arjun.mallik
-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

RE: how to append test to file

2004-11-08 Thread Bob Showalter
[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

Re: how to append test to file

2004-11-08 Thread Prasanna Kothari
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