fishy has asked for the wisdom of the Perl Monks concerning the following question:
I'm processing public budget data with Rakudo v2023.04 (Raku v6.d) using the module Text::CSV 0.012.
The input file has 150000 lines (records) and I try to load just one column (field) with:
my Str $data = slurp $file_name; my $fh = IO::String.new($data); my $csv = Text::CSV.new(';', '"'); my @column = $csv.getline_all($fh).map( *[$target_col] );
When executing I get:
> raku clean_class.raku PPP_DSP_2002-2021.csv Flattened array has 150000 elements, but argument lists are limited to + 65535 in method print at C:\workbench\budget\lib\IO\String.pm6 (IO::String +) line 40 in method new at C:\workbench\budget\lib\IO\String.pm6 (IO::String) +line 26 in method new at C:\workbench\budget\lib\IO\String.pm6 (IO::String) +line 13 in sub MAIN at clean_class.raku line 77 in block at 'SETTING::'src/core.c/Main.pm6 line 421 in sub RUN-MAIN at 'SETTING::'src/core.c/Main.pm6 line 416 in block <unit> at clean_class.raku line 15
As a workaround, I substituted line 40 of IO::String
@!content.push: |@x;
with
@!content.push: $_ for @x;
and the script runs without complaints.
I'm wondering if some other solution could be feasible?
Thanks and greetings.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: [Raku] Limited argument list issue in IO::String (Text::CSV)
by kcott (Archbishop) on May 03, 2023 at 14:24 UTC | |
|
Re: [Raku] Limited argument list issue in IO::String (Text::CSV)
by Tux (Canon) on May 03, 2023 at 15:03 UTC | |
|
Re: [Raku] Limited argument list issue in IO::String (Text::CSV)
by cavac (Prior) on May 03, 2023 at 13:33 UTC | |
|
Re: [Raku] Limited argument list issue in IO::String (Text::CSV)
by Anonymous Monk on May 03, 2023 at 13:26 UTC | |
|
Re: [Raku] Limited argument list issue in IO::String (Text::CSV)
by fishy (Friar) on May 04, 2023 at 15:04 UTC |