Hi Luc,
It's a text file and was able to retrieve the contents via the commands you have sent. The format is as follows:
hostname1,comment
hostname2, comment
So now need to filter hostnames.
Also can you let me know if we can add the conditions in the loop
if ( $hosts in $file && $cond = "comment")
{}
else ()
Thx,
Lalit