Bug 8874 - export_borrowers.pl : add a separator parameter
Summary: export_borrowers.pl : add a separator parameter
Status: RESOLVED DUPLICATE of bug 9045
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Adrien SAURAT
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-04 09:36 UTC by Adrien SAURAT
Modified: 2012-12-07 14:30 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
proposed patch (1.94 KB, patch)
2012-10-04 10:04 UTC, Adrien SAURAT
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Adrien SAURAT 2012-10-04 09:36:15 UTC
The patron export is now creating CSV files with a comma separator.
It's sometimes useful to be able to use another character as a separator.
Adding a --separator for this would help.
Comment 1 Adrien SAURAT 2012-10-04 10:04:58 UTC
Created attachment 12676 [details] [review]
proposed patch

Adds a --separator parameter.

Example of use :
./export_borrowers.pl --separator=';'
Comment 2 Frédéric Demians 2012-10-04 15:37:28 UTC
It doesn't work if you don't specify -separator: no comma as default separator. You should have:

my $separator = ',';

and maybe add a test to guaranty that the separator is 1 character length.

I would also add 'always_quote' parameter to Text::CSV constructor.
Comment 3 Marc Véron 2012-10-05 14:16:47 UTC
1)
If I indicate just one character, this character is taken as separator (as expected). If I do not indicate a separator, it takes comma (as expected).


2)
If I do something wrong like:
export_borrowers.pl -separator=':;;'
...it silently takes the first character (:)

In this case I would expect to get the usage screen.

3) 
Maybe I just do not know: How can I make use of a tab character as separator? With '\t' I get \ as separator.

4)
It would be nice to have the 'always_quote' parameter from Comment #2
Comment 4 Kyle M Hall 2012-12-07 13:32:31 UTC
Fails QA based on Marc Véron's comments.
Comment 5 Kyle M Hall 2012-12-07 14:08:46 UTC
This functionality is also included in

Bug 9045 - Adding some parameters to export_borrowers.pl
Comment 6 Kyle M Hall 2012-12-07 14:14:14 UTC
3) 
Maybe I just do not know: How can I make use of a tab character as separator? With '\t' I get \ as separator.

The answer would be $'\t'
Comment 7 Marc Véron 2012-12-07 14:30:45 UTC
Marked as duplicate based on comment #5

*** This bug has been marked as a duplicate of bug 9045 ***