SIL-Shoe

 view release on metacpan or  search on metacpan

Scripts/csv2sh  view on Meta::CPAN


=head1 NAME

csv2sh - converts Comma Separated Variables into Shoebox/Toolbox

=head1 SYNOPSIS

  csv2sh [-o file] [-u] infile

    -o file     Optional output file otherwise output goes to stdout
    -u          Assume file is in Unicode (so ignore BOM, etc.)

=head1 DESCRIPTION

csv2sh reads a comma separated variables file, as output from a spreadsheet
and converts it into standard format markers. The marker names (without \)
are assumed to be the column headers. Blank lines are ignored.

lib/SIL/Shoe/Control.pm  view on Meta::CPAN


    $fh = Symbol->gensym();
    if (not open ($fh, "$file")) {
        croak("Unable to open $file");
        return undef;
    }

    $self->{' INFILE'} = $fh;
    $self->{' fname'} = $file;
    open($fh, "$file") and ($_ = <$fh>);
    s/^\xEF\xBB\xBF//o;        # BOM in UTF8
    chomp;
    if (m/^\\\+(\S+)\s+(.*?)\s*$/o)
    { $self->{'name'} = $2; }
    else
    { croak("Malformed database type file ($file)"); }
    close ($fh);
    bless $self, $class;
}

=head2 $s->read



( run in 0.267 second using v1.01-cache-2.11-cpan-131fc08a04b )