Solved

LIST OF DIRECTORY FILES APPEND TO A TABLE

Posted on 2011-03-22
2
690 Views
Last Modified: 2012-05-11
Hi Experts
I have a  direcotory called  gdata

I woild like to append the  list of all files in gdata including extension names and size to a table called gtable.
Please help
Thnaks
0
Comment
Question by:b001
2 Comments
 
LVL 12

Expert Comment

by:jrbbldr
ID: 35192935
You can use the VFP Function   ADIR()  to get a list of files in a specified directory.

The results will go into the specified array (look in your VFP Help file for details).

You can then LOOP through the array with a FOR/ENDFOR to pick up the names and put them wherever you need.

Good Luck


0
 
LVL 27

Accepted Solution

by:
CaptainCyril earned 500 total points
ID: 35193397
CREATE CURSOR files (filename C(100), size N(12))
nCount = ADIR(aFiles,'gdata\*.*')
FOR i = 1 TO nCount
      INSERT INTO files (filename, size) VALUES (aFiles(i,1), aFiles(i,2))
ENDFOR
BROWSE
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adjust TIME parameter in Visual FoxPro config file 36 188
Insert into Excel a sum for three columns 8 661
Alternative to "Do While" 12 165
SQLite with C# using SQLiteWrapper 3 717
Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question