in reply to Building a dynamic array or some other method?
Please do the usual 'strict' and 'warning's stuff.open IN,'<',$csvfile; @data=<IN>; close IN; open OUT,'>',$newfile; print OUT shift @data; foreach my $line (@data) {$uniq{$line}=1;} foreach my $line (keys %uniq) {print OUT $line;} close OUT;
DB<2> x \%data 0 HASH(0x555e18bb11b8) 'A' => HASH(0x555e184f6448) 'B' => HASH(0x555e18bb1218) 'C' => ARRAY(0x555e18bb1290) 0 0 1 1 'X' => ARRAY(0x555e18bb1278) 0 5 DB<3>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Building a dynamic array or some other method?
by jdporter (Paladin) on Apr 23, 2024 at 14:28 UTC | |
by CAdood (Acolyte) on Apr 23, 2024 at 14:48 UTC | |
|
Re^2: Building a dynamic array or some other method?
by CAdood (Acolyte) on Apr 23, 2024 at 07:47 UTC | |
by jdporter (Paladin) on Apr 23, 2024 at 14:26 UTC | |
by choroba (Cardinal) on Apr 23, 2024 at 08:03 UTC | |
by The_Dj (Scribe) on Apr 24, 2024 at 00:59 UTC |