Comma separated files – Worth Data 5000 User Manual

Page 21

Advertising
background image

20

Comma Separated Files

Another common file format is a Comma Separated File. A TriCoder setup to upload in this format uploads data like this:

“DATA”,”DATA”(CR)

“111111”,”22”

“DATA”,”DATA”(CR) data looks like: “222222”,”33”
“DATA”,”DATA”(CR)

“333333”,”44”


Each data item is surrounded by double quotes, creating a field. Fields of data are separated by commas. The double quotes allow
commas to be used as actual data as well as separaters (see the example below). At the end of all of the fields of data, a Carriage
Return
is added to create a complete record. Modifying Program #1 as an example, the data uploaded would look like this:

“ITEM NUMBER”, “QUANTITY”

“0123456,12oz”, “15”

“ITEM NUMBER”, “QUANTITY”

“889384,8oz”, “940”

“ITEM NUMBER”, “QUANTITY”

“32834,20oz” , “7”

Where ITEM NUMBER is the first field, QUANTITY is the second field, and both fields together make a record.

To program the TriCoder to upload in this format, the first thing we must do is set the Terminator Character to “None”. The idea is
first, to stop the TriCoder from automatically sending the same character after each field of data, then second, customize the program
in the TriCoder to transmit a double quote before and after each data item, a comma after each field and a carriage return after each
record. To customize the program in the TriCoder, we use the Suffix to specify which character we want to precede or follow each
particular field. Using Program #1 as our example, we will walk through the steps required to upload Program #1 in a Comma
delimited
format:

1. Set the Terminator Character to NONE

To Change the Terminator Character in SETUP MODE.

Turn the TriCoder On
Select #5 for SETUP MODE
From the TRICODER SETUP screen choose 2 for I/O SETTINGS
Choose 2 to cycle through the TERMINATOR CHAR options
CR
Is the default – The options are: CRTABNONECR/LF
Press 0 for DONE/EXIT When you have selected NONE
Press 0 to exit TRICODER SETUP

The Terminator Character follows each piece of data in Non Portable Mode also. If you change it to NONE and still need a CR while
in Non Portable mode, program the POSTAMBLE setup parameter (in OTHER SETTINGS) to be a CR (carriage return). Use the bar
coded Full Ascii Menu to scan: CR (and LF if serial)

2. Program the Upload Prefix and Upload Suffix

After setting the Terminator Character to NONE, the next step is to enter PROGRAMMING MODE and program the Upload
Prefix
and Upload Suffix for each field of data. For Program #1, we will program the Prefix and Suffix as follows:

Statement Prompt

Prefix

Suffix

ENTER ITEM NO.

“ (double quote) “, (double quote comma)

ENTER QUANTITY

“ (double quote) “CR (double quote carriage return)

Put the TriCoder in PROGRAMMING MODE
Press 1 at the PROGRAMMING MODE screen (to edit program #1)
Press 2 at the PROGRAM #1 screen

This will take you to the

< PROGRAM #

1

PROMPT

01

>

screen


Press ENTER or the down arrow until you move the cursor to the line:

PREFIX --

_

If you have data collected in the TriCoder (assuming you are following the tutorial), you will only be able to change the Upload
Prefix
or the Upload Suffix. At the PREFIX prompt, scan the “double quote” bar code from the Full Ascii Menu.:

PREFIX --

_

Press the ENTER key to complete the change. This will move the cursor to:

Advertising