in reply to extract host, SID, port number from tnsping command

Where exactly did you get stuck?

Are you familiar with perlre?

-- 
Ronald Fischer <ynnor@mm.st>