>>>>>>>>>You must use the specific file name. You can use ADIR to get a list of files then loop though the array.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>In my directory j:\interlinkhayes are a number of csv files all of the same format delimited with commas
>>>>>>>>>>
>>>>>>>>>>If I append just 1 file as follows APPEND FROM j:\interlinkhayes\INT12345.csv DELIMITED WITH CHAR , I have no problems
>>>>>>>>>>
>>>>>>>>>>But if I try APPEND FROM j:\interlinkhayes\INT*.csv DELIMITED WITH CHAR , I get errors
>>>>>>>>>>
>>>>>>>>>>What is the simplest code for appending multiple files with a skeleton INT*.CSV
>>>>>>>>
>>>>>>>>Thanks
>>>>>>>>
>>>>>>>>Can you show me the code to get a list of all the files
>>>>>>>>
>>>>>>>>Much appreciated
>>>>>>>
>>>>>>>
>>>>>>>lcDir = ' j:\interlinkhayes\'
>>>>>>>lcSkeleton = 'int*.csv'
>>>>>>>lnFiles = adir(laFiles, lcDir + lcSkeleton)
>>>>>>>for lnX = 1 to lnFiles
>>>>>>> append from (lcDir + laFiles(lnX,1) ...
>>>>>>>Endfor
>>>>>>
>>>>>>Sorry no it doesnt work it appends 2 of the same record
>>>>>
>>>>>Probably because your files contains some identical records?
>>>>
>>>>Sorry I meant my solution contains 2 of the same record - I cant get yours to work at all - what am I doing wrong?
>>>
>>>I do spot one error in my code. Inside the loop, I forgot one ')'. Try "append from (lcDir + laFiles(lnX,1)) DELIMITED WITH CHAR , "
>>
>>lnfiles returns 0 from your code
>
>That's simply not possible, unless you have given the wrong values for lcDir or lcSkeleton, or the folder doesn't have any matching files. That's why I asked you to check for typos in your code (or description here). Another possibility is that the folder in question doesn't allow access to adir(), but I don't think that could happen.
your directory definition contained a leading space lcDir = ' j:\interlinkhayes\' - corrected that and it works - thanks for all your trouble
Colin
Specialist in Advertising, Marketing, especially Direct Marketing
I run courses in Business Management and Marketing