I convert csv files to dbf files by code.
I have the fieldnames in a array adata from a other piece of code, and want to make a dbf out of it.
The problem is that the fieldnames in csv are often longer than 10 characters.
adata contains example :
ID
Name
Price
information1
information2
information3
...
The routine below will do
ID
Name
Price
informatio
informatio
informatio
I need something like (2 digits to be save, so 8 from the fieldname and 2 incremental)
informat01
informat02
informat03
I'm working on Ascan and so, but so far no luck...
Code: Select all
function Builddbf(adata,Alengte,cDbf)
LOCAL aStru := {}
// msginfo(atostr(adata))
for i = 1 to len(adata)
cField = STRTRAN(aData[i], '"', '')
aAdd( aStru, { cField , "C", alengte[i]+1 , 0 } )
next
dbCreate( cDbf , aStru )
return