CSV Command File

The commands available in CSV command files are a subset of Loftware commands. The following commands are available: LABEL, SET, PORT, PRINTER and PRINT.

CSV stands for Comma Separated Values. CSV file is a text file in which values are delimited by comma (,) character. Such 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 in a 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 referenced label. If the variable with the name from CSV does not exist on the label, no error message is displayed.

Sample CSV Command File

The sample presents the structural view on the fields that you can use in the 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

CSV Commands Specification

The commands in the first line of data must be expressed with at (@) character. The fields without @ at the beginning are names of variables. These fields are 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 the file. For more information, see section Access to Network Shared Resources in Loftware Automation user guide. A required field.

  • @Printer: Specifies the printer to be used. It overrides the printer defined in the label. Make sure the service user can access the printer. For more information, see Access to Network Shared Resources. Optional field.

  • @Quantity: Specifies the number of labels to be printed. Possible values: numeric value, VARIABLE or UNLIMITED. For more information, see Print Label. Required field.

  • @Skip: Specifies the number of labels to be skipped 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 equals a single occurrence of printing process. Optional field.

  • @Port: Specifies 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 are saved to the variable of the same name as its value.