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
.
We will only focus on the file name conversion.
Configuration
We assume that you already have a File Processor channel configured.
- Open the Channel Options of a File Processor channel.
- Input Filter: click Add and select
Property
to Add a property filter. - Configure the property filter:
File name
,Match RegEx
, the regular expression to use:(?i).*[.][txt]
This will select only .txt files from the input. - Conversion: Click Add converter and add a
Rename files converter
. - After the
Rename to:
label click Add > Property (Parameter). Select property:File name
. - Click Add result adjuster and choose
RegEx
. - For the Regular Expression: use:
(?i)(.*[.])txt
and set the Result to use: toGroup 1
.
Click OK to close the dialog - Now you will see after the Rename to: label something similar to
$[FileName-1]
Now typezpl
(the extension- behind it so that your result would similar to this:$[FileName-1]zpl
- 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.