Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: FoxGuy Ruiz
  Where is FoxGuy Ruiz?
 hawthorne
 California - United States
 FoxGuy Ruiz
 Tags
Subject: RE: I want to append this data in a dbf...
Thread ID: 143698 Message ID: 143746 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Friday, August 31, 2007 11:58:59 AM         
   


> Hello, how can i append this data in a dbf in different rows. For every (>) character a different row.
>
>
>
>
> thanks


create cursor myData (lineContent m)
for ix=1 to alines(aContent,;
    chrtran(FileToStr("YourFileName.txt"),chr(13)+chr(10),''),1,'>')
  insert into myData values aContent[m.ix]
endfor


However to me it looks like it's more than that, separating each field with * and record with >. Something like this is also worth to try (extreme in order to not lose data):

local array aStruct[255,4]
local ix, lcTemp

lcTemp = forcepath(sys(2015)+'.txt', sys(2023))
strtoFile(;
chrtran(;
chrtran(;
FileToStr("YourFileName.txt"),chr(13)+chr(10),''), '>', chr(13)),;
m.lcTemp)

for ix=1 to 255
 aStruct[m.ix,1] = 'f'+ltrim(str(m.ix))
 aStruct[m.ix,1] = 'C'
 aStruct[m.ix,1] = 254
 aStruct[m.ix,1] = 0
endfor
create cursor myTemp from array aStruct
append from (m.lcTemp) delimited with "" with character "*"
erase (m.lcTemp)

Cetin Basoz

ENTIRE THREAD

I want to append this data in a dbf... Posted by FoxGuy Degante @ 8/31/2007 2:12:15 AM
RE: I want to append this data in a dbf... Posted by Ken Murphy @ 8/31/2007 3:09:16 AM
RE: I want to append this data in a dbf... Posted by tushar @ 8/31/2007 7:09:36 AM
RE: I want to append this data in a dbf... Posted by Cetin Basoz @ 8/31/2007 11:58:59 AM