Search by substring and extract string Share on Facebook Post on reddit Tweet on Twitter Share on LinkedIn Home › Forums › Scripting › PowerShell › Search by substring and extract string This topic has 3 replies, 3 voices, and was last updated 2 years ago by huynhgiang. Viewing 1 post (of 1 total) Author Posts ckiani7Member May 03, 2018 at 6:30 am #167535 I am trying to extract a string from a text file by matching with a substring. I cannot get my script to extract the whole line (String) when it finds the particular substring, all it does is output the substring found. Has anyone got any ideas on how this can be done. The text file is huge and is a list of dns queries all I want is the string with a particular hostname and IP address and then output this to another text file. Thanks in advance. :bowdown: Author Posts Viewing 1 post (of 1 total) You must be logged in to reply to this topic.