[Koha] Problem uploading patrons

Holger Meissner Holger.Meissner at hs-gesundheit.de
Thu Apr 4 03:54:14 NZDT 2019


Hi Paul,

you can use SciTE.

View > End of Line
Options > Line End Characters
Options > Convert Line End Characters

https://en.wikipedia.org/wiki/SciTE

Regards,
Holger

-----Ursprüngliche Nachricht-----
Von: Koha <koha-bounces at lists.katipo.co.nz> Im Auftrag von Paul Hoffman
Gesendet: Mittwoch, 3. April 2019 16:32
An: koha at lists.katipo.co.nz
Betreff: Re: [Koha] Problem uploading patrons

On Tue, Apr 02, 2019 at 11:36:36AM -0700, Elaine Bradtke wrote:
> It has taken a while to figure out what caused the patron import to fail.
> The CSV file that failed has returns between each patron instead of new
> line.   Koha doesn't parse returns as new lines and so the file kept
> failing.
> Unfortunately, the software that we get the data from exports it with 
> returns instead of new lines, and there's not a way to fix it on their end.
> I'd like to find a way to convert the returns to new lines so that the 
> assistant librarian can do the uploads without my intervention. Excel 
> doesn't seem to do the trick, unless there's a secret setting 
> somewhere (if you know, do tell!).  Does Open Office work better?

In Linux or UNIX, this command will do the trick:

    perl -i -p -e 'tr/\x0d/\x0a/' FILE

(Option -i means "change the file in place"; _perldoc perlrun_ can help you understand the other options.)

To do the same but keeping a backup with extension .bak:

    perl -i.bak -p -e 'tr/\x0d/\x0a/' FILE

To copy from FILE1 to FILE2, changing CR to LF:

    perl -p -e 'tr/\x0d/\x0a/' < FILE1 > FILE2

Paul.

--
Paul Hoffman <paul at flo.org>
Software Manager
Fenway Library Organization
550 Huntington Ave.
Boston, MA 02115
617-989-5032
_______________________________________________
Koha mailing list  http://koha-community.org Koha at lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha


More information about the Koha mailing list