Group
Extension

Matches 11

Text-CSV ( I/IS/ISHIGAKI/Text-CSV-2.04.tar.gz, HMBRAND, 2023; MetaCPAN )
Text-CSV/Text-CSV-0.007/lib/Text/CSV.pm ( view source; MetaCPAN )
$!text ~~ m{^ <[0..9]> } ?? +$!text
            !!                              $!text.unival.Int
            !! Num;
        }

    method Real {
        $!text.defined
            ?? $!text ~~ m{^ <
   return; # Default is False for both

        $!text ~~ m:m{^ <[ \x09, \x20 .. \x7E ]>+ $} or
            $!is_binary = True;

        $!text ~~ m:m{^ <[ \x00       .. \x7F ]>+ $} or
            $!i
                      $!sep ~~ m{<[\r\n]>}   and self!fail (1003);
        $!quo.defined and $!quo ~~ m{<[\r\n]>}   and self!fail (1003);
        $!esc.defined and $!esc ~~ m{<[\r\n]>}   and self!fail
Text-CSV ( I/IS/ISHIGAKI/Text-CSV-2.04.tar.gz, HMBRAND, 2023; MetaCPAN )
Text-CSV/Text-CSV-0.007/t/55_combi.t ( view source; MetaCPAN )
r escape sequence", "Illegal combo 1001");
        #%state{1001} ~~ m{"separator is equal to"} or warn "HELP";
        #%state{1001} ~~ m{"separator is equal to"} or die %state{1001};
        }
    el
te{1001}.defined and
            %attr<sep_char>    ~~ m/[\r\n]/ ||
            %attr<quote_char>  ~~ m/[\r\n]/ ||
            %attr<escape_char> ~~ m/[\r\n]/
            ) {
        ok (%state{1003}.
tate{1003} ~~ rx{"in main attr not"}, "Illegal combo (1003)");
        }
    if (%attr<allow_whitespace> and
            %attr<quote_char>  ~~ m/^[ \t]/ ||
            %attr<escape_char> ~~ m/^[ \t]/
Text-CSV ( I/IS/ISHIGAKI/Text-CSV-2.04.tar.gz, HMBRAND, 2023; MetaCPAN )
Text-CSV/Text-CSV-0.007/t/90_csv.t ( view source; MetaCPAN )
 if ($in ~~ Array && $in.elems > 0) {
        $type ~= $in.list[0].WHAT.gist;
        $type ~~ s{")("} = " of ";
        }
    my Str $s-in = sprintf "%-16s %s", $type, $in.gist;
    $s-in ~~ s:g{\n} 
> $csv),  "Sub/Obj { s-in ($in) }");
    }

# Test supported "out" formats
my $datn = $data; $datn ~~ s:g{ "\r\n" } = "\n";
for in () -> $in {
    is (csv (in => $in, out => Str, :!quote-space), $data
Text-CSV ( I/IS/ISHIGAKI/Text-CSV-2.04.tar.gz, HMBRAND, 2023; MetaCPAN )
Text-CSV/Text-CSV-0.007/t/85_util.t ( view source; MetaCPAN )
sep, ",", "Sep = ,");

for < , ; > -> $sep {
    my Str $data = "bAr,foo\n1,2\n3,4,5\n";
    $data ~~ s:g{ "," } = $sep;

    $csv.column-names (False);
    {   my $fh = IO::String.new: $data;
	ok (my
,", ";" ];
for ",", ";", "|", "\t" -> $sep {
    my Str $data = "bAr,foo\n1,2\n3,4,5\n";
    $data ~~ s:g{ "," } = $sep;

    $csv.column-names (False);
    {   my $fh = IO::String.new: $data;
	ok (my
>], "Headers");
    }

for < , ; > -> $sep {
    my Str $data = "bAr,foo\n1,2\n3,4,5\n";
    $data ~~ s:g{ "," } = $sep;

    $csv.column-names (False);
    {   my $fh = IO::String.new: $data;
	ok (my
Text-CSV ( I/IS/ISHIGAKI/Text-CSV-2.04.tar.gz, HMBRAND, 2023; MetaCPAN )
Text-CSV/Text-CSV-0.007/lib/Text/CSV.pod6 ( view source; MetaCPAN )
my $fh  = open "test.csv", :r, chomp => False;
 while (my @row = $csv.getline($fh)) {
     @row[2] ~~ m/pattern/ or next; # 3rd field should match
     @rows.push: @row;
     }
 $fh.close;

 # and wri
cept and C<False>
for records to reject.

 csv (in => "file.csv", filter => {
            $^row[2] ~~ /a/ &&  # third field should contain an "a"
            $^row[4].chars > 4  # length of the 5th fi
at have no visible data

This filter is a shortcut for

 filter => { $^row.first: { .defined && $_ ~~ /\S/ }}

This filter rejects all lines that I<not> have at least one field that does
not evaluate 
Text-CSV ( I/IS/ISHIGAKI/Text-CSV-2.04.tar.gz, HMBRAND, 2023; MetaCPAN )
Text-CSV/Text-CSV-0.007/t/30_field.t ( view source; MetaCPAN )
);
my $n = +$f;
ok ($n ~~ Num,                "Undefined in Numeric context type");
is ($n.defined,   False,      "Undefined in Numeric context defined");
my $s = ~$f;
ok ($s ~~ Str,                "U
Text-CSV ( I/IS/ISHIGAKI/Text-CSV-2.04.tar.gz, HMBRAND, 2023; MetaCPAN )
Text-CSV/Text-CSV-0.007/t/41_null.t ( view source; MetaCPAN )

    "0\n\0",
    "\0\n\0",
    );
my %exp;
for @pat -> $pat {
    my $x = $pat;
    $x ~~ s:g/\0/\\0/;
    $x ~~ s:g/\n/\\n/;
    %exp{$pat} = $x;
    }
my Str @line = ("", Str, "0\n", "", "\0\0\n0")
Text-CSV ( I/IS/ISHIGAKI/Text-CSV-2.04.tar.gz, HMBRAND, 2023; MetaCPAN )
Text-CSV/Text-CSV-0.007/t/45_eol.t ( view source; MetaCPAN )
     if ($expect.defined && $expect ~~ m/ "\r\n" /) {
                        my $r = $expect;
                        my $n = $expect;
                        $n ~~ s:g{ "\r\n" } = "\n";
            
Text-CSV ( I/IS/ISHIGAKI/Text-CSV-2.04.tar.gz, HMBRAND, 2023; MetaCPAN )
Text-CSV/Text-CSV-0.007/t/20_file.t ( view source; MetaCPAN )
and @arg = (",", "", "");
    loop (my $a = 0; $a < @arg.elems; $a++) {
	my $exp = @arg[$a];
	$exp ~~ s{^ '"' (.*) '"' $} = $0;
	is (@row[$a].text, $exp, "$tst - field $a");
	}
    ok ($csv.parse ("")
Text-CSV ( I/IS/ISHIGAKI/Text-CSV-2.04.tar.gz, HMBRAND, 2023; MetaCPAN )
Text-CSV/Text-CSV-0.007/t/16_methods.t ( view source; MetaCPAN )
ext::CSV.new,            "new");

ok (my $version = $csv.version,         "version");
ok ($version ~~ m{^ <[0..9.-]>+ $},     "CSV-$version");

is ($csv.quote_char,            '"',    "quote_char");
i
Text-CSV ( I/IS/ISHIGAKI/Text-CSV-2.04.tar.gz, HMBRAND, 2023; MetaCPAN )
Text-CSV/Text-CSV-0.007/t/79_callbacks.t ( view source; MetaCPAN )
7,g";
$fh.close;

$fh = open $tfn, :r;
sub Filter (CSV::Row $r) returns Bool { +$r[0] % 2 && $r[1] ~~ /^ <[abcd]> / ?? True !! False };
$csv = Text::CSV.new;
ok ($csv.callbacks ("filter", &Filter), "A

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.