Skip to content
Snippets Groups Projects
Commit 70de2e9d authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

enable --select when --setcol is used

parent 5d6c1ce4
Branches
No related tags found
No related merge requests found
...@@ -164,10 +164,12 @@ sub load_csv_file ...@@ -164,10 +164,12 @@ sub load_csv_file
my $fi_open; my $fi_open;
(*FI, $fi_open)= $obj->open_csv_file ($fnm); (*FI, $fi_open)= $obj->open_csv_file ($fnm);
unless ($obj->{'no_headings'}) $obj->load_csv_file_headings (*FI) unless ($obj->{'no_headings'});
{
$obj->load_csv_file_headings (*FI);
if (@{$obj->{columns}} # NOTE: columns might have been defined using $obj->define_columns(...)
&& exists ($obj->{fidef})
)
{
my ($fidef)= map { $obj->{$_} } qw(fidef); my ($fidef)= map { $obj->{$_} } qw(fidef);
if (defined ($fidef)) if (defined ($fidef))
{ {
......
...@@ -112,6 +112,7 @@ while (defined (my $arg= shift (@ARGV))) ...@@ -112,6 +112,7 @@ while (defined (my $arg= shift (@ARGV)))
elsif ($opt eq 'search' || $opt eq 'select') elsif ($opt eq 'search' || $opt eq 'select')
{ # TODO: allow multiple searches! { # TODO: allow multiple searches!
$search_string= $val || shift (@ARGV); $search_string= $val || shift (@ARGV);
# print __LINE__, " search_string=[$search_string]\n";
} }
elsif ($opt eq 'max') { $max_items= $val || shift (@ARGV); } elsif ($opt eq 'max') { $max_items= $val || shift (@ARGV); }
elsif ($opt eq 'hdr') { $view= 'header'; } elsif ($opt eq 'hdr') { $view= 'header'; }
...@@ -193,7 +194,7 @@ if (@set_columns) ...@@ -193,7 +194,7 @@ if (@set_columns)
$csv->{'no_headings'}= 1; $csv->{'no_headings'}= 1;
} }
# print "find_pattern=[$find_pattern] search_string=[$search_string]\n"; # print __LINE__, " find_pattern=[$find_pattern] search_string=[$search_string]\n";
if (defined ($find_pattern)) if (defined ($find_pattern))
{ {
...@@ -244,14 +245,15 @@ print "procssing find_pattern=[$find_pattern]\n"; ...@@ -244,14 +245,15 @@ print "procssing find_pattern=[$find_pattern]\n";
if (defined ($search_string)) if (defined ($search_string))
{ {
# print "procssing search_string=[$search_string]\n";
my ($field_name, $field_value)= split ('=', $search_string, 2); my ($field_name, $field_value)= split ('=', $search_string, 2);
# print __LINE__, " procssing search_string=[$search_string] field_name=[$field_name] field_value=[$field_value]\n";
# the filter is dynamically generated since the field number is only # the filter is dynamically generated since the field number is only
# known after the column names are identified! # known after the column names are identified!
sub fidef2 sub fidef2
{ {
my $obj= shift; my $obj= shift;
# print __LINE__, " in fidef2\n";
my $cols= $obj->{'columns'}; my $cols= $obj->{'columns'};
my $col= 0; my $col= 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment