Hello everyone, can someone help me,
how can I look for a character string example "name of the road" in a field address of a dbf file.
how can i use a index recherche
many thanks
find a word in a field of a dbf file
Moderator: Rathinagiri
- fouednoomen
- Posts: 188
- Joined: Sun Oct 14, 2012 8:33 am
- DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
- Location: Tunisia
- serge_girard
- Posts: 3166
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: find a word in a field of a dbf file
How many records in your DBF?
If less than 10.000 I would do something like this:
Serge
If less than 10.000 I would do something like this:
Code: Select all
aFOUND := {}
DO WHILE .NOT. EOF()
IF 'someting' $ dbffield1 .OR. 'someting' $ dbffield2 // ETC....
AADD(aFOUND, RECNO())
ENDIF
SKIP
ENDDO
CLOSE ALL
FOR A = 1 TO LEN(aFOUND)
? aFOUND [A]
NEXT
There's nothing you can do that can't be done...
Re: find a word in a field of a dbf file
Hello,fouednoomen wrote: ↑Wed Sep 25, 2019 9:48 am how can I look for a character string example "name of the road" in a field address of a dbf file.
how can i use a index recherche
Please take a look for a discussion at
http://hmgforum.com/viewtopic.php?f=13& ... eek#p58881
HTH
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
- dragancesu
- Posts: 921
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: find a word in a field of a dbf file
Maybe finction AT() help you
*** we found string 'something'
SET FILTER TO AT( 'someting', dbffield ) > 0
dbgotop()
p.s. this solution is not optimal but is easy
*** we found string 'something'
SET FILTER TO AT( 'someting', dbffield ) > 0
dbgotop()
p.s. this solution is not optimal but is easy
- fouednoomen
- Posts: 188
- Joined: Sun Oct 14, 2012 8:33 am
- DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
- Location: Tunisia
Re: find a word in a field of a dbf file
Many thanks for all
Re: find a word in a field of a dbf file
I use
temp = "temp"
index on address to temp for "somestreet" $ address
browse ???
set index to
temp := alltrim(temp)+".ntx"
erase (temp)
Franco
temp = "temp"
index on address to temp for "somestreet" $ address
browse ???
set index to
temp := alltrim(temp)+".ntx"
erase (temp)
Franco
All The Best,
Franco
Canada
Franco
Canada
- SALINETAS24
- Posts: 667
- Joined: Tue Feb 27, 2018 3:06 am
- DBs Used: DBF
- Contact:
Re: find a word in a field of a dbf file
Hola, muy buena idea.
Yo utilizo esta forma lo aplico sobre el BROWSE activo, y funciona muy bien.
_cArea : Alias de la DBF
xCadena : lo que quiero buscar
_cArea->Campo : Es el Campo de la DBF donde quiero saber si exite la xCadena
y me selecciona aquellos registros que devuelvan un valor mayor que cero
Saludos a todos y vamos con una cervecita
dragancesu wrote: ↑Wed Sep 25, 2019 12:39 pm Maybe finction AT() help you
*** we found string 'something'
SET FILTER TO AT( 'someting', dbffield ) > 0
dbgotop()
p.s. this solution is not optimal but is easy
Yo utilizo esta forma lo aplico sobre el BROWSE activo, y funciona muy bien.
Code: Select all
(_cArea)->( dbSetFilter( {|| AT(xCadena,_cArea->Campo)> 0 },"AT(xCadena,_cArea->Campo)> 0" ) )
xCadena : lo que quiero buscar
_cArea->Campo : Es el Campo de la DBF donde quiero saber si exite la xCadena
y me selecciona aquellos registros que devuelvan un valor mayor que cero
Saludos a todos y vamos con una cervecita
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no.