-1

Do you know how to append a .csv file into DBF by using FoxPro command , instead of using import wizard?

I have tried the code below, but it is not working.

Code:

Append from getfile() Delimited With , 
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
CTC Yi
  • 1
  • 1
  • 1

1 Answers1

1

You can use append from:

local lcFileName
lcFilename = getfile()

if !empty(m.lcFileName)
  append from (m.lcFileName) type delimited
endif

This would do appending including the header line. However, if you have a field that is not character, then you could use it to skip header line. For example say there is a column named theDate of type date and should not be empty, then you could say:

  append from (m.lcFileName) type delimited for !empty(theDate)

Or if you are appending into an empty cursor, you could say - ... for recno()>1.

Cetin Basoz
  • 22,495
  • 3
  • 31
  • 39