Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to import data from text file to table
Message
From
10/05/2002 11:25:54
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
10/05/2002 10:47:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00655063
Message ID:
00655086
Views:
23
This message has been marked as the solution to the initial question of the thread.
>Hello all
>
>
>I have table zip
>
>zip c(5)
>countycd c(2)
>countyname c(15)
>
>how to import this zip into table, i have more lines of zipcode like this.
>
>14041,14042,14065,14101,14129,14133,14138,14168,14171,14173,;
>14706,14719,14726,14737,14741,14743,14748,14749,14751,14753,;
>14755,14760,14766,14770,14772,14778,14779,14783,14788
>
>txs

This sample doesn't have countycd and countyname just zip as I get.

lcStr = chrtran(filetostr('zips.txt'),chr(13)+chr(32),chr(10))
lcStr = strtran(lcStr,';'+chr(10),'')
lnZips = alines(arrZips, chrtran(lcStr,',',chr(13)))
dimension arrZips[alen(arrZips),1]
create table myZips (zip c(5))
append from array arrZips
alter table myZips add column countycd c(2)
alter table myZips add column countyname c(15)

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform