How to create barcode labels with data from a CSV (comma-separated values) file?
This tutorial shows you how to use Barcode & Label to create labels with data from a CSV (comma-separated values) file.
1. First, tap or click on the "+" button in Barcode & Label and select "New Label".
2. In "Templates", select the "SLE003" Letter template and click on the "Create" button. When prompted, click on the "OK" button to confirm that you want to create a new label.
3. Next, click on the "Setup Fields" button from the top "Ellipsis" button in Barcode & Label.
4. Select "CSV File" (Comma-Separated Values File) as the Variable Type. We are going to import values from a CSV file and use the data in our labels.
5. Click or tap on the "Select" button and pick a .csv or .txt file. We have prepared a Sample.csv that you can download and use for this tutorial. You may also continue this tutorial with your own CSV file.
6. Select the "Sample.csv" file and then click on the "Open" button. You should see the following:
The "First Row as Field Column Headers" check box lets you specify whether the first row of the CSV file is used as column names (headers). When you create text or barcode objects, you can select columns from this CSV file to be used as a data source. The column headers will help you easily identify which columns to use.
Note - When this label is saved, the CSV file will be automatically stored as part of the label. This enables you to load labels without having to setup the CSV file again. The “Clear” button will remove the CSV file so that it will no longer be saved as part of the label file.
7. We are now ready to create text and barcode objects that use data from a CSV file. Click or tap on the "Text" object in the toolbar at the bottom of the app.
8. Drag your finger or mouse on the label to create the object. Double tap or click on the text object to bring up the "Text Properties" Flyout.
9. In the "Type" drop down list, select "CSV Column 01 : CSV01". This selection indicates that we will use the first column of the CSV file as data for this Text object.
You may have noticed the column name "Product" is also displayed in this field (and in the object). This is because we have specified to use the "First Row as Field Alias" in step 6. If you had not checked "First Row as Field Alias" option, Barcode & Label will simply display the column as "CSV Column 01 : CSV01", which represents the first column of the CSV File.
10. Finally, you can click or tap on the "Preview" button to preview the labels.
11. Click on the "Done" button to go back to the label designer screen. Next, click on the "Barcode" object at the bottom of the app and then drag your finger or mouse on the label canvas to create the object.
12. Double click on the barcode object to bring up the "Barcode Properties" Flyout. Select "CSV Column 02 : CSV02 (ProductID)" as the "Type". You have setup the barcode object to use the "ProductID" column from the CSV file.
13. Click on the "Preview" button to preview the label. You should see the barcode labels with data from the CSV file as shown below: