Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Appending from csv files
Message
From
18/02/2015 10:06:26
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01615469
Message ID:
01615519
Views:
36
>>>>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
>
>
>lnfiles is 0

you can use sys(2000) too instead of adir:
lcDir = ' j:\interlinkhayes\'
lcSkeleton = 'int*.csv'
lcFile=sys(2000,lcSkeleton)
do whil !empt(lcFile)
   append from (lcDir + lcFile ...
lcFile=sys(2000,lcSkeleton,1)
Endd
I didn't try this code, might syntax error(s)...
Previous
Reply
Map
View

Click here to load this message in the networking platform