CSV Command File
The commands available in CSV command files form a subset of Loftware commands. You can use the following commands: LABEL, SET, PORT, PRINTER and PRINT.
CSV command file can be executed using the following actions:
CSV command file is a text file in which the values are delimited by comma (,) character. The text file can contain Unicode value (important for multi-language data). Each line in the CSV command file contains commands for a single label print action.
The first row of CSV command file must contain commands and variable names. The order of commands and names is not important, but all records in the same data stream must follow the same structure. Variable name-value pairs are extracted automatically and sent to the label that is referred to them.
Note
No error is raised if the variable with its name included in the CSV does not exist on the label.
CSV Command File Definition
The commands in the first line of data must be expressed with at (@) character. The fields without @ at the beginning are names of variables, and they will be extracted with their values as name-value pairs.
@Label. Specifies the label name to be used. It's a good practice to include label path and filename. Make sure the service user can access file. For more information, see the topic Access to Network Shared Resources in Loftware Automation user guide. Mandatory field.
@Printer. Specifies the printer to use. It overrides the printer defined in the label. Make sure the service user can access the printer. For more information, see the topic Access to Network Shared Resources in Loftware Automation user guide. Optional field.
@Quantity. Specifies the number of labels to print. Possible values: numeric value, VARIABLE or UNLIMITED. For more information, see the topic in Loftware Automation user guide. Mandatory field.
@Skip. Specifies the number of labels to skip at the beginning of the first printed page. This feature is useful if you want to re-use the partially printed sheet of labels. Optional field.
@IdenticalCopies. Specifies the number of label copies that should be printed for each unique label. This feature is useful when printing labels with data from database or when you use counters, and you need label copies. Optional field.
@NumberOfSets. specifies the number of times the printing process should repeat. Each label set defines the occurrence of the printing process. Optional field.
@Port. Specified the port name for the printer. You can override the default port as specified in the printer driver. You can also use it to redirect printing to file. Optional field.
Other field names. All other fields define names of variables from the label. The field contents will be saved to the variable of the same name as its value.
CSV Command File Example
The sample below presents a structural overview of fields that you can use in a CSV command file.
@Label,@Printer,@Quantity,@Skip,@IdenticalCopies,NumberOfSets,@Port,Product_ID, Product_Name label1.nlbl, CAB A3 203 DPI, 100, , , , , 100A, Product 1 label2.nlbl, Zebra R-402, 20, , , , , 200A, Product 2