Re: Weird Error Msg



On Feb 5, 6:34 pm, Bryan Oakley <oak...@xxxxxxxxxxxxxxxxxxxx> wrote:
SuNnY wrote:
Hi all !!

I am working on file and string searching. while executing my code , i
am getting this strange error msg. i tried everything but cudnt crack
what tclsh is trying to tell me ...

here is the complete error msg:

list element in quotes followed by "." instead of space
while executing
"foreach Str $TestStr {

"List element in quotes followed by <some character>" means the variable
doesn't contain a valid list (by virtue of it having a non-whitespace
character immediately after a quoting character).

My guess is, you're taking a random string from a file or from user
input and are trying to use it as a Tcl list, which you should not be doing.

--
Bryan Oakleywww.tclscripting.com

Hi !!

Well yes, i have to search for a particular string in a directory. my
idea is to search for particular type of file, and search for
particular string in each file.
But when while searching for files in a directory, the program stops
when it encounters more than one "." in the file/directory name. I try
to catch the list of the files in a list and then by using foreach i
am reading and searching file for particular string.

How to over come this ? problem

Also can someone guide me to complete documentation on file searching
( not the content of file)
..
changing root directory using 'cd' command is what I have done...but
it doesn't look decent, because i have to put many looping statement
(for eg foreach, while, if...)
any online tutorial on file searching would be of help.

thnx

.



Relevant Pages

  • Re: Weird Error Msg
    ... I am working on file and string searching. ... to catch the list of the files in a list and then by using foreach i ... puts "Searching file $file Textdata ....." ...
    (comp.lang.tcl)
  • Re: Weird Error Msg
    ... foreach file $txtfile { ... puts "Searching file $file Textdata ....." ... want to match a glob-style pattern, a regular expression, or a fixed string. ...
    (comp.lang.tcl)
  • Re: System.AccessViolationException
    ... internal string theAP; ... DataColumn col = new DataColumn; ... private string _pwd; ... foreach ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Weird Error Msg
    ... set TestStr ... foreach Str $TestStr { ... and i am looking for this string in these particular files only. ... There's something going on down at the "string match or regexp ..." ...
    (comp.lang.tcl)
  • Re: Weird Error Msg
    ... foreach file $txtfile { ... set TestStr ... want to match a glob-style pattern, a regular expression, or a fixed string. ... Your files do not contain lists, and the foreach expects it's second argument to be a list. ...
    (comp.lang.tcl)