Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AutoIncrement and Importing Data
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01189260
Message ID:
01189679
Views:
6
>>Hey Guys!
>>
>>I was wanting to import a large text file (comma delimited) into a table.
>>
>>The first field in the table is an autoincrementing field.
>>
>>When I import the data, the data acts like field 1 went into the AUTOincrementing field (yikes!), field 2 to where field 1 is suppose to go, field 3 to where field 2 was suppose to go.....
>>
>>Sample text file....
>>
>>
>>UPC    Name    Amount    Class
>>40001 ,Joe    ,20.0     ,A
>>60002 ,Mary   ,31.2     ,B
>>20003 ,Gary   ,44.3     ,C
>>
>>
>>When imported into the table.....
>>Table foo
>>
>>Rec_ID          UPC     Name      Amount      Class
>>AutoIncrement
>>1               Joe     20.0      A
>>2               Mary    31.2      B
>>3               Gary    44.3      C
>>
>>
>>Will I have to REMOVE the Autoincrementing field, or move it to the END of the table??
>>
>>Thanks!
>>Tommy
>
>lcCommand = [APPEND FROM MyFile FIELDS ]
>FOR lnFor = 2 TO FCOUNT([MyTable])
>    lcCommand = lcCommand + FIELDS(lnFor,[MyTable])+[, ]
>NEXT
>lcCommand = LEFT(lcCommand, LEN(lcCommand)-1) +[ TYPE .... DELIMITED .....]
>
>(not tested at all)

Thanks... I will test it today if I have some time available....

Tommy
Tommy Tillman A+ NetWork+ MCP
Previous
Reply
Map
View

Click here to load this message in the networking platform