I am trying to step thru a list of 27,000 addresses delimited with the "�"
character and then checking against a name list for addresses to be removed,
which I am doing by simply replacing them with a "� Deleted" string.

this seems simple enough, but something is not working . . .

on mouseUp
  set the caseSensitive to false
  set the itemdelimiter to "�"
  answer file "Select A Text File"
  put it into tPath
  put url ("file:"&tPath) into theFileData
  put field "tTextField" into theNamestoRemove
          #a list of about 120 names we don't want on the lst
  repeat for each item x in theFileData
    repeat for each line y in theNamestoRemove
      if  x  contains y then
        put "� Deleted" & cr into item x of theFileData

# the above line is the problem, x at this point contains\
# the data in that item, the complete address, and is not the ordinal
# number of the item in theFiledata that is a match in that repeat loop.
     
 end if
    end repeat
  end repeat
  put theFileData into url ("file:"&tPath)
end mouseUp

The repeat handler could be written like this and would be "iron clad" but
take a horrendously long time:

 set the itemdelimiter to "�"
 repeat with x = 1 to (the number of items of theFileData)
    repeat with y = 1 to the number of lines of theNamestoRemove
      if  item x of theFileData  contains (line y of theNamestoRemove) then
        put "� Deleted" & cr into item x of theFileData
       end if
    end repeat
  end repeat

thanks!
Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
www.HinduismToday.com
[EMAIL PROTECTED]


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to