NAME
Sweet::File::DSV
SYNOPSIS
Given a file.dat
in your home dir.
FIELD_A|FIELD_B
foo|bar
2|3
|
Create a pipe separated value file instance.
my $dir = Sweet::HomeDir->new;
my $file = Sweet::File::DSV->new(
dir => $dir ,
name => 'file.dat' ,
sep => '|' ,
);
|
INHERITANCE
Inherits from Sweet::File
.
ATTRIBUTES
separator
Field separator. Must be provided at creation time or in a sub class with _build_sep
method.
METHODS
num_rows
field
say $file ->field(0);
say $file ->field(1);
|
fields
my @fields = $file ->fields;
|
split_row
my $cells = $self ->split_row->(0);
say $_ for @$cells ;
|
rows
SEE ALSO
Delimiter-separated values Wikipedia page.