Re: "Del" char and removing item from a list
Re: "Del" char and removing item from a list
- Subject: Re: "Del" char and removing item from a list
- From: Emmanuel <email@hidden>
- Date: Fri, 26 Jan 2001 19:54:47 +0100
At 17:41 +0100 26/01/01, FlyMac wrote:
>
Ok, I have a text file with 3 lines in it (for example):
>
--
>
From Nick1 : hello this is a test
>
From Nick2 : come on let's test again ;)
>
From Nick3 : yep this is a test, too.
>
--
>
And of course I have to delete the second line so that line 3 comes directly
>
under line 1. I can make the line to " " but it doesn't remove the line. How
>
can I do that?
It will be easier with an app. I use Smile much (since we make it), and
with Smile (on an open text window), this would amount to:
--------------------- tested
set paragraph 2 of window 1 to ""
---------------------
>
Next question: I've been surprised to see how it's difficult to remove an
>
item from a list. I have a list with some strings in it (ex: {Nick1, Nick2,
>
Nick3...}) and I just want to erase Nick2 so that the list becomes {Nick1,
>
Nick3}. For info I have to get the Nick to remove from a string. I tried
>
some things like that:
>
set NickList to every item of NickList whose item is not NickList
>
but unsucessful.
>
>
Thanks a lot for reading this e-mail and even more if you have a solution,
Still this would be easier if you can work on a text window of Smile (but
other text editors would surely do the job as well), since you would then
rely on the "Text Suite" of AppleScript, a richer component than the
(non-existing) "List Suite".
--------------------- tested
set first paragraph of window 1 where it begins with "From Nick2" to ""
---------------------
HTH
Emmanuel