RDD

DbImportCsv()

Import UTF-8 CSV records into the current work area

Syntax

Signature
DbImportCsv( cFile ) --> nRecords

Arguments

cFile

CSV file whose header names match fields in the current work area.

Return value

The number of records imported.

Description

DbImportCsv() reads a UTF-8 CSV file and appends records to the current work area. Columns are matched to fields by the names in the header row.

Notes

The current work area must be open and writable.

Example

DbImportCsv.prg
PROCEDURE Main()

   DbUseArea( .T., , "people.dbf", "People" )
   QOut( DbImportCsv( "people.csv" ) )
   DbCloseArea()

   RETURN

Output

See also