>>>Hi All,
>>>
>>>When using the APPEND command on a CSV file, does the FIELDS clause represent the names of the columns in the CSV or the DBF?
>>
>>The DBF
>>
>>>
>>>And, does the order in the FIELDS clause represent the order in the CSV or the DBF?
>>
>>The CSV
>>
>>Tamar
>
>My error. The source file is actually a CVS format.
>
>For example: In the destination DBF there is a field named ComPrac_ID. But in the source CVS, it is named Common_Prac_ID.
>
>Also, I am not appending all the fields, but only a select number of the fields.
Then you'll have to create a dummy cursor with the fields you want to skip. The names of fields in the csv are irrelevant - they are ignored (and will probably pollute your table, Fox doesn't have the option to skip the header). So the fields list is not related to fields in the csv, it's to be taken as "first field from csv goes into the first field in the list, 2nd into the 2nd" etc. It's more of "where do csv fields go", not "which scv fields do I want" - you can't pick one and drop another, you can only ignore fields to the right of the last one you listed. If csv has 10 fields and your list has only six, the last four will be ignored.
So if you want to skip some fields, create a cursor with fields named as in the target table, in the order they are in the csv, with placeholder fields (with names not matching any of those in the dbf) for those you want to skip. Append into that cursor, check if you have the header record in it, then append to your dbf from dbf("yourCursorAlias") for ConditionWhichIsTrueExceptForHeaderRecord.