Barcode & Label Functions
Barcode & Label supports the application of functions such as padding, formatting currency and rounding on data stored in an Excel spreadsheet or a CSV file. The following is a list of functions supported by Barcode & Label.PadLeft
- Total Length: This is the maximum length of the result after padding. If the field to be padded has a length that is more than the Total Length, no padding will be applied and the original input will be used as the result.
- Pad Character: The character used to pad the input field.
PadRight
- Total Length: This is the maximum length of the result after padding. If the field to be padded has a length that is more than the Total Length, no padding will be applied and the original input will be used as the result.
- Pad Character: The character used to pad the input field.
Currency
- Input Number Format: Some countries use "." as the decimal point and "," as the thousand separator while some countries use "," as the decimal point and "." as the thousand separator. If the default "Use System" value is applied, Barcode & Label will detect the Locale of the System (Device) and then used the Locale to parse the number in the Excel spreadsheet or CSV file. Alternatively, you can specify a Locale by selecting a Country (Language) in this option. Barcode & Label will then use the Locale of the country and its relevant Number Format to parse the input number.
- Currency: Different countries use different symbols for the currency and have unique ways of displaying the currency. This option enables you to specify the specific currency format by selecting the Country (Language). It is possible for a country to format the currency differently based on the language used.
- No.of Decimals: The number of decimal points used for formatting the currency. By setting the Currency option above, the number of decimal points will be automatically set up. This option provides a means to overwrite the default number of decimal points based on the Locale.
Round
- No. of Decimals: The number of decimal points used for rounding the number.
- Number Format: Some countries use "." as the decimal point and "," as the thousand separator while some countries use "," as the decimal point and "." as the thousand separator. If the default "Use System" value is applied, Barcode & Label will detect the Locale of the System (Device) and then used the Locale to parse the number in the Excel spreadsheet or CSV file. Alternatively, you can specify a Locale by selecting a Country (Language) in this option. Barcode & Label will then use the Locale of the country and its relevant Number Format to parse the input number.
Tutorial on using Functions on data stored in a CSV file
This tutorial illustrates the use of the Label Wizard to import fields from a CSV file and then applying Functions to format the imported fields. The aim is to create a Product Label with Product Name, Description, Currency Formatted Price and a Product ID barcode. An Excel spreadsheet can also be used as the data source with very similar steps described below.1. Download NumbersSample.csv from https://www.barcoderesource.com/NumbersSample.csv. This is the CSV File (comma separated) that we are going to use as our data source.
2. Click on the "+" button on the top app bar of Barcode & Label and select "New Label Wizard". The Label Wizard enables you to select label templates and the data source. The wizard will also generate objects that correspond to the column fields in the CSV file.
3. In "Select Label Template", select the "Standard SLE002 - 3 x 2" label template. This is illustrated in the screenshot below.
4. In "DataSource", select "CSV File" and click on the "Create Label and Select CSV". When prompted to "Create New Label", click on the "OK button.
5. Next, select the NumbersSample.csv file downloaded in Step 1. The app will import the data from the CSV file and create a label with objects corresponding to the column fields in the CSV file.
The following objects are created in the label:
- Product ID
- Product Name
- Product Description
- Weight
- Price
6. Double click on the "Product ID" object, scroll down to the "Function Options" property and select the "PadLeft" function. Change the "Total Length" to "6" and leave the "Pad Character" as "*". We are padding the “Product ID” with the "*" character up to a total maximum of 6 characters.
7. Next, double click the "Weight" object, scroll down to the “Function Options” property and select the "Round" function. Change the "No.of Decimals" to "1" and leave the "Number Format" field as "Use System". We are rounding the “Weight” field to 1 decimal point. When you save your label design, all these settings will be saved as part of the label.
8. Double click on the "Price" object, scroll down to the "Function Options" property and select the "Currency" function. Change the "Currency" field to "Sterling - United Kingdom" (or any other currency that you prefer). This will format the “Price” in Pounds.
9. Next, we are going to create a barcode. Click on the "Barcode" icon on the bottom app bar. Drag your mouse or finger across the canvas to create the barcode. Double click on the barcode object and change the "Type" to "CSV Column 01 : CSV01 (Product ID)". This will create a barcode that uses the Product ID from the same CSV file as the input data. The label should look like the screenshot below. “fnc” characters on the label is used to indicate that a function is applied on an object.
If you need more barcodes such as Code128, I2OF5 or EAN13 that comply strictly with Industry Specifications (ISO/GS1), please check out our ConnnectCode Barcode Software and Fonts package. The fonts in the package can be imported into Barcode & Label to generate all commonly used linear barcodes that meet the strictest requirements of the auto-id industry.
10. Click on the "Save" icon on the top app bar to save the label for future use.
11. Finally, click on the "Preview" button to preview and print the labels. You see the following output. The “Product ID” is left padded with “*” up to a total maximum length of 6 characters. The “Weight” object is rounded to 1 decimal point and the “Price” object is formatted to Sterling (United Kingdom).
Tip
You can refresh the CSV file at any time by clicking on the "..." (Ellipsis) button on the top app bar and select "Setup Fields". In "Variable Type", select "CSV File" and click on the "Select" button. When you are done, the updated CSV File will be used as the data source of your label.About Comma Delimited Files Format and Number Format
Barcode & Label supports the import of a CSV (Comma Separated Files) file in a format where the comma “,” character is used as a column separator. The table below illustrates a sample format of a CSV file supported by Barcode & Label.Product ID,Product Name,Product Description,Weight,Price 81000,Pen Set,Black,3.413,9.90 81001,Pencil Set,10 Pcs,3.425,9.90 81002,Calculator,Silver Color,3.250,15.20 81003,Mouse,Laser Scroll View,2.512,29.90 81004,Note Book,8 inch x 4 inch,3.511,5.50 |
In some countries, the “,” character is used as a decimal point and this may have an impact on the format above. To resolve the issue, simply place the numbers in quotes (“) as shown below. This will enable Barcode &Label to import the file successfully.
Product ID,Product Name,Product Description,Weight,Price 81000,Pen Set,Black,"3,413","9,90" 81001,Pencil Set,10 Pcs,"3,425","9,90" 81002,Calculator,Silver Color,"3,250","15,20" 81003,Mouse,Laser Scroll View,"2,512","29,90" 81004,Note Book,8 inch x 4 inch,"3,511","5,50" |
If a “Round” function needs to be applied on a number field such as the “Weight” column shown above, simply set the “Number Format” to a Locale (Country) that supports “,” as the decimal point. This is illustrated in the screenshot below where the “Number Format” is set to the “Germany” locale.
Future versions of Barcode & Label will also be adding support for the use of other characters such as a “;” (semicolon) as a column separator.