AutoHotkey Community

It is currently May 27th, 2012, 1:07 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: January 7th, 2010, 5:41 am 
i have two lists
one list is of admins and other of mods

admins
dylan
carasi
shawn
paul
valicous


mods
dylan
chris
carasi
priya
cupcakes
shawn
paul
valicous

i want to remove the admins from mods list ... ( subract items of admins list from mods list )

the resulted list should be
chris
priya
cupcakes


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 7:14 am 
Offline

Joined: May 12th, 2005, 8:20 am
Posts: 331
Location: Münster, Germany
Hi, Guest (a nick would be nice),
I assume you've got your lists in memory.
Now you parse the first one (have a look at the loop-command) with the admins to access the admins one by one. For each found admin you try to remove him from the second list (have a look at the StringReplace-command). That's it! Watch out for admin-names which are substrings of mod-names and handle them with care!
Regards,
Klaus
PS: In case of non success, post your code and there will be help!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2010, 7:16 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
If you have admins.txt and mods.txt you could use http://www.autohotkey.net/~hugov/tf-lib ... _Substract
Code:
TF_Substract("admins.txt", "mods.txt")


Edit: This also works with vars like so
Code:
admins=
(join`r`n ; this is important to add if you work with vars
dylan
carasi
shawn
paul
valicous
)

mods=
(join`r`n
dylan
chris
carasi
priya
cupcakes
shawn
paul
valicous
)

; i want to remove the admins from mods list ...
; ( subract items of admins list from mods list )

MsgBox % TF_Substract(admins, mods)

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Leef_me, Ohnitiel, WillTroll and 24 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Group