Bugzilla – Attachment 148435 Details for
Bug 33285
It should be possible to specify the separator used in runreport.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33285: Allow specifying the delimeter for runreport.pl
Bug-33285-Allow-specifying-the-delimeter-for-runre.patch (text/plain), 1.71 KB, created by
Nick Clemens (kidclamp)
on 2023-03-20 20:12:51 UTC
(
hide
)
Description:
Bug 33285: Allow specifying the delimeter for runreport.pl
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-03-20 20:12:51 UTC
Size:
1.71 KB
patch
obsolete
>From fc84450818ae648f19a270f60dd005f50962bda1 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 20 Mar 2023 20:08:56 +0000 >Subject: [PATCH] Bug 33285: Allow specifying the delimeter for runreport.pl > >To test: >1 - Write a report in koha >2 - perl misc/cronjobs/runreport.pl --format csv 1 (or correct report number) >3 - Note you get commas >4 - Apply patch >5 - Repeat #2 - no change >6 - perl misc/cronjobs/runreport.pl --format csv --separator "|" 1 >7 - Now it is pipe delimited >8 - perl misc/cronjobs/runreport.pl --format tsv --separator "|" 1 >9 - Error is reported, you cannot set separator unless csv >10 - Try other separators >--- > misc/cronjobs/runreport.pl | 10 ++++++++++ > 1 file changed, 10 insertions(+) > >diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl >index 8b3c12b3b0..c8ba5bed08 100755 >--- a/misc/cronjobs/runreport.pl >+++ b/misc/cronjobs/runreport.pl >@@ -183,6 +183,7 @@ my $separator = ','; > my $quote = '"'; > my $store_results = 0; > my $csv_header = 0; >+my $csv_separator = ""; > > my $username = undef; > my $password = undef; >@@ -195,6 +196,7 @@ GetOptions( > 'man' => \$man, > 'verbose' => \$verbose, > 'format=s' => \$format, >+ 'separator=s' => \$csv_separator, > 'to=s' => \$to, > 'from=s' => \$from, > 'subject=s' => \$subject, >@@ -219,6 +221,14 @@ unless ($format) { > $format = 'text'; > } > >+if( $csv_separator ){ >+ if( $format eq 'csv' ) { >+ $separator = "$csv_separator"; >+ } else { >+ print STDERR "Cannot specify separator if not using CSV format\n"; >+ } >+} >+ > if ($format eq 'tsv' || $format eq 'text') { > $format = 'csv'; > $separator = "\t"; >-- >2.30.2
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 33285
:
148435
|
148769
|
148770
|
148771
|
148775
|
149058
|
149059