This instruction PatternFindStr, func, state, val = PatternFindStr(s$, pat$) how work it? I want make a single program to find keywords in text and file names for example mad word in file names as madhouse, etc., how I can do the compare of a filename?
I hope write my question clear and simple. Thanks.
PatternFindStr, how work it?
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: PatternFindStr, how work it?
If you just want to search for words, it's easier to use FindStr().
- Juan Carlos
- Posts: 887
- Joined: Mon Sep 06, 2010 1:02 pm
Re: PatternFindStr, how work it?
Thanks for the idea, because I'm working with the PatterFindStrAndreas wrote:If you just want to search for words, it's easier to use FindStr().
- Juan Carlos
- Posts: 887
- Joined: Mon Sep 06, 2010 1:02 pm
Re: PatternFindStr, how work it?
I tested the FindStr() in this code:
Where I read the files inside of drawer and I want search one file that has the word America as name, but it doesn't show me the file/s with this name, where is the problem and I want show a list where I can clicking on the file with the name to example show it, also How is programm?
Code: Select all
TextoBuscado={}
ficheros$ = {}
directorios$ = {} ;En el array introducimos el nombre de las subcarpetas.
;Nota no muestra carpeta origien, sólo subcarpetas.
NumFicheros=ReadDirectory(Directorio$, ficheros$, directorios$)
TextoBuscar$ = "America"
For Busqueda=0 To NumFicheros Step 1
TextoBuscado=FindStr(ficheros$[Busqueda], TextoBuscar$[True])
Next
FicherosBusqueda=ListItems(TextoBuscado$)
Paso=10
For MuestraFicheros=0 To FicherosBusqueda Step 1
TextOut(200, Paso, TextoBuscado$[MuestraFicheros]) ;Poner entre el número de ficheros.
Paso=Paso+10
Next
Re: PatternFindStr, how work it?
Stayin on topic
Is PatternFindStr() is able to separate lines of text at \r or at \n characters?
I am a bit lost in the wood of the search patterns.
The full problem is, that I want the most elegant solution to load a text file to string then process it line by line.
Every help welcome!
Bye
Is PatternFindStr() is able to separate lines of text at \r or at \n characters?
I am a bit lost in the wood of the search patterns.
The full problem is, that I want the most elegant solution to load a text file to string then process it line by line.
Every help welcome!
Bye
Re: PatternFindStr, how work it?
Maybe I found it:
PatternFindStr(data$,"(%C+)")
%C+ means all non control characters.
But what are the control characters? Are the tab is a control character?
PatternFindStr(data$,"(%C+)")
%C+ means all non control characters.
But what are the control characters? Are the tab is a control character?
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: PatternFindStr, how work it?
Yes, TAB (\t) is a control character as are \r and \n. PatternFindStr() shouldn't be affected by them.