Testing the import of a CSV file

This procedure shows how to test importing sample data from a spreadsheet into HCL Informix®.

Files containing comma-separated values (CSV) are a commonly used for transferring simple text data between programs. The CSV format uses a comma as a field separator and a new line as a record separator. Double quotation marks are used to embed commas, new lines, or double quotation marks within strings. Some applications (for example, some spreadsheet applications) provide the option of exporting text data in the CSV format.

To test importing a CSV file:

  1. Create a test database and simple table in Informix.
  2. In your spreadsheet application:
    1. Create a spreadsheet with columns that correspond to the columns in your Informix table.
    2. Populate the columns with some test data.
    3. Export the data by saving it in .csv format.
  3. Copy the resulting .csv file and paste it in a location that you can access from ipload.
  4. Start ipload and choose Components > Generate Job to create a job.
  5. In the Generate Job window:
    1. Select Load/Unload Job in the Generate group.
    2. Select Delimited in the Format Type group.
    3. Specify the .csv file as the source for input to the new job you are creating. Specify a name in the Generate Name field, select your database in the Database field, select you table in the Table field, and then insert the full path to the .csv file in the Device field.
    4. Click OK.
  6. Load the job by choosing Jobs > Load.
  7. While you can do many things (such as filtering and mapping) on the Load Job window, for this test, select the Format button.

    The Delimited Format window appears. You use this window to define the format of the input file.

  8. In the Delimited Format window, click the Options button to display the Delimited Options window.
  9. In the Delimiter Options window, change the value in the Field Separator field to , (a comma) and click OK.

    The ipload utility returns you to the Delimited Format window.

  10. In the Delimited Format window, click OK.

    The ipload utility returns you to the Load Job window.

  11. Click Run to run the job.

    The ipload utility displays status information while the job runs, and then it displays the results of the job.

  12. Click OK twice to return to the main ipload window.

As an evaluation, you can use DBAccess to verify that the data was successfully loaded.

For more information, see Generating load and unload components.

Copyright© 2018 HCL Technologies Limited