My Current Practice:-
Open Excel Files.
Alt+ F (File) ->Open -> Change File Of Type to 'text' .txt
Then -> select the text files to open.
Choose Delimited.
Start import at row 2. (Row 1 is header format)
File Origin: 437 OEM United States.
Click Next>
Choose Tab,SemiColon,Comma and Space.
Then Click Next.
Column Data Format: Do not import column (Skip)
Click Finished.
Adjusted the column width.
Alt+F (File) --> Save as
Change File Type: Microsoft Excel 5.0/95 Workbook (.xls)
Save.
Example Filename save as ABC.xls
Then close the Excel Documents.
Then at Visual FoxPRo TYPE COMMAND :-
Import From ABC xls
BROWSE
then the data succesfully Import
SO --> I hope can simplify the steps above.
Any suggestion?
Some more I need manually Change the data structure of the table import to follow the first row. (Ignore imported first row data (start at row 2, since is not a data previously.)
But if you want to use Excel.....
Some 'tricks' about saving an Excel file as a DBF.
1. Make your top row, a row of field names (limited to 10 characters with no spaces).
2. Highlight/Select all rows & columns that you want to export, but NO other rows or columns.
3. Make each Text column slightly wider than Auto-fit makes it, so as to prevent en-expected field value truncation
4. Even though Excel column data is set as Text, if the data appears like numbers, Excel will export it as numbers.
If you want that column to be characters, insert a row below the top (field name) row and insert a character above the numbers. This 'dummy' row can be deleted later.
5. Remember that Excel is limited in the number of rows that it can handle. If your text file is too large, Excel will chop off the rows that it cannot handle.
6. Also note that the steps that you currently use above can all be automated as a process within VFP.
You do not tell us if this is a one-time import or if this has to be done repeatly.
If one-time any of these suggestions will work.
If repeatedly, then you may want to consider automating the process in VFP with one of Mike's suggestions, or VFP automation of your existing procedure or even low-level operations (FOPEN(),FGET(),etc.).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.