{"id":3958,"date":"2021-11-06T12:05:07","date_gmt":"2021-11-06T12:05:07","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=3958"},"modified":"2021-11-06T12:05:47","modified_gmt":"2021-11-06T12:05:47","slug":"vbscript-to-locate-specific-strings-and-start-reading-a-file","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/vbscript-to-locate-specific-strings-and-start-reading-a-file\/29399.html","title":{"rendered":"Vbscript To Locate Specific Strings And Start Reading A File"},"content":{"rendered":"<p>Hi Vbgurus,<\/p>\n<p>I&#8217;m trying to put together a script about which I&#8217;m not getting things right. Hope you may help me in getting it done.<\/p>\n<p>I&#8217;m looking for a vbscript that will search for a specific string, if found, check for first occurence of another string and read the line that follow it. For e.g. my file would be like,<br \/>\n&#8230;.<br \/>\n&#8230;..<br \/>\n&#8230;&#8230;<br \/>\nSTAGE<br \/>\n&#8230;..<br \/>\n&#8230;..<br \/>\n&#8230;..<br \/>\n&#8230;.<br \/>\nFROM<br \/>\n&lt;string to be extracted&gt;<br \/>\n&#8230;<br \/>\n&#8230;<br \/>\n&#8230;.<br \/>\nAs in the above example, the script should search for the word &#8220;STAGE&#8221; first, if found check for the first occurence of word &#8211; &#8220;FROM&#8221; and read the line that follows &#8211; FROM.<\/p>\n<p>NOTE &#8211; My file would have many such occurences and hence, I should search like above, and keep writing the STAGE, FROM &amp; the immediate line to an xl file.<\/p>\n<p>Thanks in advance for any help that you may offer.<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":5},"question-category":[55],"question_tags":[],"class_list":["post-3958","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/3958","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=3958"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=3958"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=3958"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=3958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}