Hi,
If I understand correctly, you're trying to update a file "in
place" by processing it via a "repeat for each" structure. I don't
think MC will apply the updates. Instead, you can recreate the
file; I suggest a way in your code below.
Also, if you ever want to refer to an item AND a line within that
item in the same statement, I don't believe MC will accept it. I
think last time I tried it, MC told me that items are subsets of
lines, and not vice versa.
Regards,
Phil
Sivakatirswami wrote:
>
> 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
########## CHANGES ##########
> #put "� Deleted" & cr into item x of theFileData
> put "� Deleted" & cr after theNEWFileData
> else
put y & cr after theNEWFileData
> # 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
########## CHANGE ##########
> #put theFileData into url ("file:"&tPath)
> 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.
--
Phil Davis
--------------------
[EMAIL PROTECTED]
days: (503) 986-1215
eves: (503) 557-5656
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.