Example Schema: Comma Separated Values (csv)

This example demonstrates the use of the special "csv" format and the use of a delimiter other that comma (a vertical bar). Each record is on a new line. Each field is quoted and fields are separated by a vertical bar.

database /tmp/testdb
table  customer
# indicate csv format with a delimiter of |
csv |
#       Name            Type            Tag
field   CustID          varchar(10)     1
field   Company         varchar(80)     2
field   Address         varchar(80)     3
field   City            varchar(20)     4
field   State           varchar(10)     5
field   Zip             varchar(10)     6
field   Country         varchar(10)     7
field   Phone           varchar(20)     8

Here is sample data for the above schema. Notice that the first line contains column names, instead of actual data. This record will be ignored because the keepfirst keyword was not used.

"ALWAO"|"Quick Mart"|"77 Overpass Ave."|"Provo"|"UT"|"84604"|
"USA"|"(801) 555-7424"
"ANDRC"|"Continental Food"|"P.O. Box 209"|"Bellingham"|"WA"|
"98226"|"USA"|"(206) 555-9574"
"ANTHB"|"Anthony's Ale"|"33 Neptune"|"Clifton Forge"|"WA"|"24422"|
"USA"|"(509) 555-8647"
"BABUJ"|"Babu Ji's"|"Box 29938"|"London"||"WX1 5LT"|"UK"|
"(71) 555-8248"

Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.