Hi!
I have to search in a text if there is a certain string.
In details I have to check if a file is in a folder.
So i get the list of files with "the files"
Now searching the web i found the "find" command, but it seems that it draw a box around a text instead of answer if is it found or not.
How should i do to know if the text is present or not?
OT: I found in the dictionary that every command is well explained but not the results.
You know, you can find for every command what it does but not where it place its "result".
I think that more than Syntax, summary and examples, every command should have an "OUTPUT" section to tell the user what and where does the command/function give back.
search text result
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: search text result
Look up foundText and foundLine. 

-
- Posts: 91
- Joined: Tue Sep 03, 2013 1:53 pm
Re: search text result
beeing a search of a file in a folder, I'm searching in "the files" is correct to write something like this?
Code: Select all
set the defaultFolder to specialFolderPath("documents")
put the files into tFileList
find "censimentofiliere.txt" in tFileList
if the foundText is "censimentofiliere.txt" then
Re: search text result
Hi Geppo,
since the FIND command is intended to give a visual feedbak (square around the found word/chunk)
this should be used for finding things inside of fields in LC.
When searching for strings in text files or even fielnames in file listings, using "lineoffset" is much more efficient!
Best
Klaus
since the FIND command is intended to give a visual feedbak (square around the found word/chunk)
this should be used for finding things inside of fields in LC.
When searching for strings in text files or even fielnames in file listings, using "lineoffset" is much more efficient!
Code: Select all
set the defaultFolder to specialFolderPath("documents")
put the files into tFileList
put lineoffset("censimentofiliere.txt",tFileList) into tFoundLine
if tFoundLine = 0 then
## not found
else
file is existent in listing
end if
Best
Klaus
-
- Posts: 91
- Joined: Tue Sep 03, 2013 1:53 pm
Re: search text result
...Klaus..my personal trainer 
thank you very very much

thank you very very much
