You are here: Setup Guide > Set Up Data Sources > Connect to CSV Text Files

Connect to CSV Text Files

This topic describes how to create a new OLE-DB data source to connect to a text CSV file for use with Endicia Professional. With OLE-DB, Endicia Professional can read a comma-separated text file with a column heading line.

If you need to post back data to specific rows in a CSV file, or work with many different CSV files with unique file names, you can connect directly to Microsoft Excel. For more information see, See "About Connecting to Microsoft Excel" and See "Set Up Data Post-Back".

If your CSV text file is comma-separated and has a header line, you can start at Step 1 below. If your CSV text file is tab-separated or does not have a header line, you must create a text file called "schema.ini" and place it in the folder with the CSV text file. The schema.ini file contains format information that OLE-DB uses when accessing the CSV text file. You can create the schema.ini file with Notepad, for example. It should contain lines similar to this:

[SHIPMENTS.CSV]

COLNAMEHEADER=FALSE

FORMAT=CSVDELIMITED

MAXSCANROWS=25

CHARACTERSET=OEM

COL1="ORDER NUMBER" CHAR WIDTH 255

COL2="NAME" CHAR WIDTH 255

COL3="ADDRESS 1" CHAR WIDTH 255

COL4="ADDRESS 2" CHAR WIDTH 255

COL5="CITY" CHAR WIDTH 255

COL6="STATE" CHAR WIDTH 255

COL7="POSTAL CODE" CHAR WIDTH 255

COL8="COUNTRY" CHAR WIDTH 255

COL9="PHONE" CHAR WIDTH 255

COL10="EMAIL" CHAR WIDTH 255

You must edit the first line to match the name of your CSV text file. You will also need to edit the Col1, Col2, (and so on) lines to match the column names in your file. More or fewer Col lines may be needed, depending on the contents of your file.

If your file is tab-separated, change the Format line to:

Format=TabDelimited

The first time that you run Endicia Professional, the Database Connections Setup wizard starts automatically.

Afterward, you can manually start the Database Connections Setup wizard.

Steps

  1. For a new OLE-DB connection, select Create a new data source (using OLE-DB), and click Next.
  2. In the Data Provider field, select Text/CSV File, and click Next.
  3. Click the Browse button and locate and select your CSV file.
  4. Click Open.
  5. The data file location and source appear in the Location area of the Create Data Source dialog box.

  6. If your CSV file has a header line with column heading names, select the First row is a header (contains column names) check box.
  7. If your CSV file does not have column heading names, see the beginning of this topic.

  8. Only in special circumstances, such as under the directions of technical support, select the Show the database connection string check box.
  9. Otherwise, do not select the check box.

  10. Click Next.
  11. If you selected the Show the database connection string check box, the panel displays the connection string.
  12. Click Next.
  13. If you were advised by technical support to change the connection string, enter the changes.
  14. Click Next.
  15. Enter a name of your choice for the data source name, and click Next.

  16. Click OK to finish the wizard.
  17. The Order Lookup Data Map window displays your data source name.

After you have specified the OLE-DB data source to use with Endicia Professional, the Create a SELECT Statement wizard runs that helps you specify the SELECT statement to retrieve data from your data source CSV text file.

 


 

Image of Endicia Logo

Copyright © 2017 Endicia. All Rights Reserved.