Bugzilla – Attachment 147187 Details for
Bug 33050
Allow to specify quote char in runreport.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33050: More args for misc/cronjobs/runreport.pl
Bug-33050-More-args-for-misccronjobsrunreportpl.patch (text/plain), 2.31 KB, created by
Fridolin Somers
on 2023-02-23 06:43:07 UTC
(
hide
)
Description:
Bug 33050: More args for misc/cronjobs/runreport.pl
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2023-02-23 06:43:07 UTC
Size:
2.31 KB
patch
obsolete
>From b55ebb4d5dbb9cbcaead5bcbbace0bf4e5a41f93 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 22 Feb 2023 20:40:14 -1000 >Subject: [PATCH] Bug 33050: More args for misc/cronjobs/runreport.pl > >Add to script misc/cronjobs/runreport.pl args for CSV : > * separator character > * quote character > * no quote (by default double quote) > >See perl doc https://metacpan.org/pod/Text::CSV#new > >Test plan : >Play with each arg and compare results of runreport.pl >--- > misc/cronjobs/runreport.pl | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > >diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl >index 8b3c12b3b0..36b42d7da0 100755 >--- a/misc/cronjobs/runreport.pl >+++ b/misc/cronjobs/runreport.pl >@@ -63,6 +63,9 @@ runreport.pl [ -h | -m ] [ -v ] reportID [ reportID ... ] > --subject=s subject for the e-mail > --param=s parameters for the report > --store-results store the result of the report >+ --separator separator character for CSV >+ --quote quote character in CSV >+ --no-quote no quote character in CSV > --csv-header add column names as first line of csv output > > >@@ -129,6 +132,18 @@ Store the result of the report into the saved_reports DB table. > > To access the results, go on Reports > Guided reports > Saved report. > >+=item B<--separator> >+ >+Separator character for CSV, by default comma. >+ >+=item B<--quote> >+ >+Quote char in CSV, by default double quote. >+ >+=item B<--no-quote> >+ >+No quote char in CSV. >+ > =back > > =head1 DESCRIPTION >@@ -181,6 +196,7 @@ my $subject = ""; > my @params = (); > my $separator = ','; > my $quote = '"'; >+my $no_quote = 0; > my $store_results = 0; > my $csv_header = 0; > >@@ -205,6 +221,9 @@ GetOptions( > 'password:s' => \$password, > 'method:s' => \$method, > 'store-results' => \$store_results, >+ 'separator=s' => \$separator, >+ 'quote=s' => \$quote, >+ 'no-quote' => \$no_quote, > 'csv-header' => \$csv_header, > > ) or pod2usage(2); >@@ -298,6 +317,7 @@ foreach my $report_id (@ARGV) { > quote_char => $quote, > sep_char => $separator, > }); >+ $csv->quote_char(undef) if $no_quote; > > if ( $csv_header ) { > my @fields = map { decode( 'utf8', $_ ) } @{ $sth->{NAME} }; >-- >2.39.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33050
:
147187
|
147188
|
152499
|
156133
|
158207
|
158208