http://qs1969.pair.com?node_id=214804


in reply to Replacing a text field in a spreadsheet

You could always reffer to the items you need as:
$line[0] $line[6]
etc...

-Nitrox

Replies are listed 'Best First'.
Re: Re: Replacing a text field in a spreadsheet
by jonnyfolk (Vicar) on Nov 21, 2002 at 16:55 UTC
    I thought I was getting somewhere with this:
    ... open (IN, "$data") || die "Couldn't get $data page"; my @all = <IN>; close (IN); open (IN2, ">$data.tmp") || die "Couldn't open temporary file"; foreach my $line (@all) { my ($one,$two,$three,$four,$five,$six,$seven) = split "\t",$line; if ($three eq $checkthree) { ($one,$two,$three,$four,$five,$six,$seven) = @line; last; } } rename("$data.tmp", "$data") || die "Couldn't rename file"; print "okay";
    As it went through and printed "okay".
    Unfortunately it wiped the file so obviously my definition of "okay" is different to perl's :-)
    What to do?