in reply to Re: load a file in memory and extract parts
in thread load a file in memory and extract parts
I tried the following code
sub TestArray { my @file_array; my $InputFile = "/home/test/test_file.dat"; # '|' separator file my $column; my $row; tie @file_array, 'Tie::File', $InputFile or die $!; shift @file_array; foreach $row (0..@file_array-1) { foreach $column (0..@{$file_array[$row]}-1) { $LOG->info( "Element [$row][$column] = $file_array[$row][$ +column]\n"); } } }
At this point I'm trying to load the file into a multidimentional array. The file has 10 columns and 50,000 rows. How can I extract data from this array. When I run this, I'm getting the following error: Can't use string ("DEAL_NAME|TRANCHE_NAME|GROUP_NO|") as an ARRAY ref while "strict refs" in use at ./test_feeds.pl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: load a file in memory and extract parts
by toolic (Bishop) on May 06, 2015 at 16:52 UTC | |
by healingtao (Novice) on May 06, 2015 at 17:17 UTC | |
by afoken (Chancellor) on May 06, 2015 at 19:31 UTC |