diff --git a/modules/util/Util/Simple_CSV.pm b/modules/util/Util/Simple_CSV.pm index 3a9c49275aa496ca13ef856f2164f2a556fcde4c..6bfce5822db993d05490fcc5148b91aaaaa275d1 100644 --- a/modules/util/Util/Simple_CSV.pm +++ b/modules/util/Util/Simple_CSV.pm @@ -442,6 +442,19 @@ sub define_columns $obj->{'column_count'}= scalar @columns; } +=head2 my $data= $csv->data () + +=cut + +sub data +{ + my $obj= shift; + + return undef unless (exists ($obj->{data})); + + (wantarray) ? @{$obj->{data}} : $obj->{data}; +} + =head2 $csv->add_row (@data) add another data line to csv object diff --git a/modules/util/csv.pl b/modules/util/csv.pl index 7991ca4702df316c89e214a2cec9a894d53d4149..78af845158ff283e62534bae018fc2c89aa6e89c 100755 --- a/modules/util/csv.pl +++ b/modules/util/csv.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: csv.pl,v 1.50 2017/08/02 10:10:50 gonter Exp $ +# $Id: csv.pl,v 1.51 2017/11/27 12:29:10 gonter Exp $ =pod @@ -89,8 +89,8 @@ my $sort_numeric= 0; my $strip_quotes= 0; my $view= 'matrix'; # values: matrix, extended, header, json, dumper my $all= 0; # for extend view, sofar... -my $find_pattern= undef; -my $search_string= undef; +my $find_pattern= undef; # this is used for a pattern match +my $search_string= undef; # this is used to select a certain value in a column my $max_items= undef; sub set_utf8 { $UTF8= 1; binmode (STDOUT, ':utf8'); }