> "EM" == Eric Mooshagian writes:
EM> I would like a subroutine that will allow me to easily put columns
EM> of a tab delimited file into their own arrays.
EM> I've been calling the following repeatedly for each column:
EM> my @array1 = getcolvals($filehandle, 0);
EM> my @array2 =
Dear All,
I would like a subroutine that will allow me to easily put columns of a tab
delimited file into their own arrays.
I've been calling the following repeatedly for each column:
my @array1 = getcolvals($filehandle, 0);
my @array2 = getcolvals($filehandle, 1); ...etc.
sub getcolvals {
> "ab" == a b writes:
ab> Hey Thanks all!
ab> I got it ;)
ab> open (FH, "+< $fname")|| die "\nFailed to open file $fname\n";
you don't need to open the file at all. truncate can take a filename.
ab> my $tmp=$fsize-$trunccount;
where do those get set? don't name var
> "ab" == a b writes:
ab> I need to truncate last few bytes of file. these files are big in size.
ab> One idea is to write needed bytes to another file and delete the original
ab> file, but i am dealing with big files :(
ab> dont want to use truncate, it just truncating the size, al
On May 20, 4:37 am, cmksw...@gmail.com (Ambuli) wrote:
> Here i paste a perl script to delete last Two Lines. If you want
> delete more lines in a file you can specify it.
>
> use File::ReadBackwards;
> my $filename = 'test.txt';
> my $Lines_to_truncate = 2; # Here the line to truncate is mean Re
Hi Ambuli,
a few comments on your code:
On Friday 20 May 2011 14:37:52 Ambuli wrote:
> Here i paste a perl script to delete last Two Lines. If you want
> delete more lines in a file you can specify it.
>
>
Always start with "use strict;" and "use warnings".
> use File::ReadBackwards;
Include
Hey Thanks all!
I got it ;)
open (FH, "+< $fname")|| die "\nFailed to open file $fname\n";
my $tmp=$fsize-$trunccount;
seek(FH,$tmp,0);
$addr = tell(FH) ;
truncate(FH, $addr)|| die "\nFailed to truncate $file: $!";
close(fd);
print "\nTrunca
Here i paste a perl script to delete last Two Lines. If you want
delete more lines in a file you can specify it.
use File::ReadBackwards;
my $filename = 'test.txt';
my $Lines_to_truncate = 2; # Here the line to truncate is mean Remove
only Last Two Lines
my $bw = File::ReadBackwards->new( $fil
On Fri, May 20, 2011 at 03:40:35PM +0530, a b wrote:
> Hi All,
>
> I need to truncate last few bytes of file. these files are big in size.
>
> One idea is to write needed bytes to another file and delete the original
> file, but i am dealing with big files :(
>
> dont want to use truncate, it j
Hi All,
I need to truncate last few bytes of file. these files are big in size.
One idea is to write needed bytes to another file and delete the original
file, but i am dealing with big files :(
dont want to use truncate, it just truncating the size, all data is gone
any pointers
Thanks
a b
10 matches
Mail list logo