Renaming .txt text files to Zebra Printer Language .zpl files

General

This article will guide you on how to automatically rename .txt files to .zpl files in a File Processor channel.
This might be useful in case your ERP dumps .txt files containing Zebra Printer Language (ZPL) codes and you want to process and print them directly as .zpl.

Click here to configure a File Processor channel to automatically monitor and print ZPL files to a printer.

We will only focus on the file name conversion.

Configuration

We assume that you already have a File Processor channel configured.

  1. Open the Channel Options of a File Processor channel.
  2. Input Filter: click Add and select Property to Add a property filter.
  3. Configure the property filter: File name, Match RegEx, the regular expression to use: (?i).*[.][txt]
    This will select only .txt files from the input.
  4. Conversion: Click Add converter and add a Rename files converter.
  5. After the Rename to: label click Add > Property (Parameter). Select property: File name.
  6. Click Add result adjuster and choose RegEx.
  7. For the Regular Expression: use: (?i)(.*[.])txt
    and set the Result to use: to Group 1.
    Click OK to close the dialog
  8. Now you will see after the Rename to: label something similar to $[FileName-1]
    Now type zpl (the extension- behind it so that your result would similar to this: $[FileName-1]zpl
  9. Click OK to close the dialogs.

What we did here in steps 7. and 8. is selecting the file name part without the extension and then using that file name part and adding zpl behind it. For example: Foo.txt we select Foo. using a regular expression (group 1) and then reuse this and append the new file extension: Foo.zpl.

Note: to edit a property parameter again you can double click the $[FileName-..] text.