Please, I need your help, whoever you may be interested in, I have this small code in foxpro to fill a database with from a txt file. What happens to me is that in xbase, I only fill the first field, the other fields do not recognize them, if someone please could tell me or help solve this, thank you.
Close All
Set Safety oFF
Select 0
Use Ponches Exclusive
Zap
Append From C:\PONCHES\Ponches.Txt Type Delimited
Close All
Set Safety On
Quit
Help please, it does not work on xbase
- Jose Marte
- Posts: 12
- Joined: Sun Dec 11, 2016 7:52 am
- Location: Republica Dominicana
Re: Help please, it does not work on xbase
Assuming the .txt file is comma delimited, try:
Append From "C:\PONCHES\Ponches.Txt" DELIMITED
IF the .txt file is fixed length fields, try:
Append From "C:\PONCHES\Ponches.Txt" SDF
The commands "Set Safety oFF" and "Set Safety oN" are not needed
HTH,
Terry
Append From "C:\PONCHES\Ponches.Txt" DELIMITED
IF the .txt file is fixed length fields, try:
Append From "C:\PONCHES\Ponches.Txt" SDF
The commands "Set Safety oFF" and "Set Safety oN" are not needed
HTH,
Terry
Re: Help please, it does not work on xbase
not sure what FoxPro have default sign for Delimited so look into your *.TXTJose Marte wrote:Append From C:\PONCHES\Ponches.Txt Type Delimited
guess it is ";" so try
Code: Select all
Append From C:\PONCHES\Ponches.Txt DELIMITED WITH ";"
greetings by OHR
Jimmy
Jimmy
Re: Help please, it does not work on xbase
Hi, when I converted my Clipper programs to Xbase, I had problem with append like this :
append from &infuvi DELIMITED with ";"
Now I use this :
SELECT 1
use &fpdbf
nHandle:=DC_TxtOpen(infuvi)
do while !DC_TxtEof(nHandle)
cLine:=DC_TxtLine(nHandle)
IF 1->(DC_AddRec(5))
if len(cLine)>254
replace riadok with substr(cLine,1,254)
replace riadok_ with substr(cLine,255,254)
else
replace riadok with cLine
endif
1->(dbRUnlock())
ENDIF
DC_TxtSkip(nHandle,1)
enddo
* zatvorenie text.súboru
DC_TxtClose(nHandle)
In this example I controlling length of line to 254 characters, but this can disable
append from &infuvi DELIMITED with ";"
Now I use this :
SELECT 1
use &fpdbf
nHandle:=DC_TxtOpen(infuvi)
do while !DC_TxtEof(nHandle)
cLine:=DC_TxtLine(nHandle)
IF 1->(DC_AddRec(5))
if len(cLine)>254
replace riadok with substr(cLine,1,254)
replace riadok_ with substr(cLine,255,254)
else
replace riadok with cLine
endif
1->(dbRUnlock())
ENDIF
DC_TxtSkip(nHandle,1)
enddo
* zatvorenie text.súboru
DC_TxtClose(nHandle)
In this example I controlling length of line to 254 characters, but this can disable
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Help please, it does not work on xbase
Here is a system that you develop and improve:Jose Marte wrote:Please, I need your help, whoever you may be interested in, I have this small code in foxpro to fill a database with from a txt file. What happens to me is that in xbase, I only fill the first field, the other fields do not recognize them, if someone please could tell me or help solve this, thank you.
Close All
Set Safety oFF
Select 0
Use Ponches Exclusive
Zap
Append From C:\PONCHES\Ponches.Txt Type Delimited
Close All
Set Safety On
Quit
http://lc.kubagro.ru/aidos/_Aidos-X.htm
Everything is there: the executable modules, source code, and databases. You might need it for something.
The system has a hierarchical menu screens, use graphics, work with texts, databases, and directly with the files on the signs, work with Internet through http and ftp protocols.
- Jose Marte
- Posts: 12
- Joined: Sun Dec 11, 2016 7:52 am
- Location: Republica Dominicana
Re: Help please, it does not work on xbase
Thanks, thank you very much for all your comments and valuable help, thanks for taking a little of your busy time to answer, I hope to continue counting on your help, since I am starting in the migration to xbase, thank you.


