Yes it does work, but I'm guessing you tried to go directly to using the new code without reading my post, such as where I said...

Originally Posted by maroon
When you are reading the file, it returns the first match, so this always returns the #test1 line for the 1st host, and the #test3 line for the 2nd host. You can change the script to keep reading multiple times to find more than 1 line having their address, by starting the search at different lines in the file, but it would be simpler for you to have each address appear 1 time like hostname.irccloud;#test3 #test2

So that means you need a different format for your text file. For your last example, it should instead have each hostname on ONE line, like:

188.26.59.16;#freeirc
id-586239.lymington.irccloud.com;#test1 #test2 <----- same address
161.184.143.251;#freeirc
id-455146.ilkley.irccloud.com;#test1 #test2 #test3 <----- same address