Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Attempting to Import Census Date into Fox Table
Message
From
28/09/2003 01:55:48
 
 
To
27/09/2003 17:38:53
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00832945
Message ID:
00832978
Views:
14
Just to add to Jim's strtran() suggestion...
You could use a combination of VFP low level file handling functions (fopen(), fread(), fcreate(), fwrite()) to read chunks of the file, translate the EOR to chr(13)+chr(10) and write the result to a new file which then could be used to populate a table with APPEND FROM ... TYPE SDF.
Reading in smaller chunks get around file size limits and allows you to provide some sort of progress indicator.

>Are they fixed format/fixed length records?
>
>I presume that you've tried with APPEND FROM. If so, what problems did you encounter?
>
>I donn't know if FILETOSTR() will handle a file that big, but it may be worth a try to read it in that way and translate the oddball EOR to a CR/LF or something more practical.
>
>People here may come up with some ideas if you can better describe the data and what you've tried.
>It sounds like they are fixed length and that TYPE SDF doesn't work because of the oddball EOR. I wonder if DELIMITED (one or the other) works with SDF/... something maybe to play with.
>
>good luck
>
>
>>I have been attempting to import recently released 2000 Census data (http://ftp2.census.gov/census_2000/datasets/PUMS/FivePercent/) into a Fox table. There seems to be no utility for importing text data in VFP 6 or 7. I have managed to import some of the smaller states into Access and export to a dBase IV file. However, Access seems to choke on the larger files. For example, the California data is in a text file that is in excess of 600MB and contains in excess of 3,000,000 records. Each record contains 165 fixed width fields, is 317 bytes wide, and has a funky End of Record delimiter. Access seems to choke on the size of the California data, whereas, it seems to handle files of < 500,000 records quite easily. My puter has 1GB of RAM and plenty of free hard drive to page. Any ideas as to how I might import this into Fox or Access or any other program so that I can ultimately get it into Fox? I have tried importing to SQL Server 2000. However, I can't get it to recognize the EOR
>>delimiter (Access does recognize the delimiter) and give me the proper record length.
>>
>>Any ideas??
>>TIA
>>Jim
Previous
Reply
Map
View

Click here to load this message in the networking platform