Search code examples
stripspaceszebra-printersremoving-whitespacezpl

How to remove spaces from barcode in Zebra (ZPL) label?


I have a Canadian zip code that arrives with a space in the middle. There is no way to change the data, and it's fine for the human readable field. The barcode field, however, cannot have a space in it. Looking for a way to remove that pesky space from showing up in the barcode field.

In the past I've used ^TB (text block) to truncate human readable fields, but I think this isn't an option with a barcode. I've poured over the documentation and found nothing...

Here's my code currently:

^BY2,0.0
^FT0215,0526^BCN,0114,N,N,N,N
^F8^FV>:420*zip_code^FS

Anyone know a way out of this pickle?


Solution

  • ZPL is best described as a markup language, there are no string functions or anything to remove spaces. The spaces must be removed before merging with the ZPL code.