Remove leading zeros from barcode

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Remove leading zeros from barcode

Nalisha Tamang
Dear all,
This time I need to change my barcode previously I had added 0 in front of
barcode number e.g if barcode is 2560 then I added 002560 to make it six
digit for 12 = 000012 but now I want only the numbers no leading zeros for
4700 books is there a way to remove all leading zeros from the barcode?any
command????
_______________________________________________

Koha mailing list  http://koha-community.org
[hidden email]
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
Reply | Threaded
Open this post in threaded view
|

Re: Remove leading zeros from barcode

mbarham
Dear Nalisha,

You can update that on database level items table.

parse to int will remove leading zeros, then save again.


Regards





[cid:image002.png@01D327F4.25E9A910]


Mohamad Barham

System Engineer | Information Technology Department

Birzeit University

P.O.Box. 14, Birzeit, Palestine

Tel: + 970 22982012 | Mob: +970 597 861929 | Ext: 5616

[hidden email] | www.birzeit.edu<http://www.birzeit.edu/>






________________________________
From: Koha <[hidden email]> on behalf of Nalisha Tamang <[hidden email]>
Sent: Tuesday, February 25, 2020 11:52 AM
To: Koha <[hidden email]>
Subject: [Koha] Remove leading zeros from barcode

Dear all,
This time I need to change my barcode previously I had added 0 in front of
barcode number e.g if barcode is 2560 then I added 002560 to make it six
digit for 12 = 000012 but now I want only the numbers no leading zeros for
4700 books is there a way to remove all leading zeros from the barcode?any
command????
_______________________________________________

Koha mailing list  http://koha-community.org
[hidden email]
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
~~~~~~~~~~~~~~~~~~~~~~~~~~
The information contained in this communication is intended solely for the use of the individual or entity to whom it is addressed and others authorized to receive it. It may contain confidential or legally privileged information. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately by responding to this email and then delete it from your system. The University is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt.
~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________

Koha mailing list  http://koha-community.org
[hidden email]
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
Reply | Threaded
Open this post in threaded view
|

Re: Remove leading zeros from barcode

Ere Maijala
In reply to this post by Nalisha Tamang
Nalisha,

Resorting to SQL, this should do it:

update items set barcode=TRIM(LEADING '0' FROM barcode);

Best,
Ere

Nalisha Tamang kirjoitti 25.2.2020 klo 11.52:

> Dear all,
> This time I need to change my barcode previously I had added 0 in front of
> barcode number e.g if barcode is 2560 then I added 002560 to make it six
> digit for 12 = 000012 but now I want only the numbers no leading zeros for
> 4700 books is there a way to remove all leading zeros from the barcode?any
> command????
> _______________________________________________
>
> Koha mailing list  http://koha-community.org
> [hidden email]
> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
>

--
Ere Maijala
Kansalliskirjasto / The National Library of Finland
_______________________________________________

Koha mailing list  http://koha-community.org
[hidden email]
Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha