Bug 8874

Summary: export_borrowers.pl : add a separator parameter
Product: Koha Reporter: Adrien SAURAT <adrien.saurat>
Component: Command-line UtilitiesAssignee: Adrien SAURAT <adrien.saurat>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P5 - low CC: f.demians, kyle, veron
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9045
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: proposed patch

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 ***