Results 1 to 3 of 3

Need help with logic to parse through output being returned to excel from wsh

Threaded View

  1. #1
    Registered User
    Join Date
    02-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Need help with logic to parse through output being returned to excel from wsh

    Hello fellow Excelbots:

    I need some help with how to parse through a stream of output and find/extract a string. There seems to be a lot of posts regarding parsing a text file, which is not exactly what I am doing. I'm calling an executable which returns 4 lines of output, as follows (line numbers not present in output):
    Line1: //
    Line2: // 
    Line3: // some text here
    Line4: a string of exactly 32 characters, then a filename
    I need to grab the string of characters as one var and the filename as another, so I can perform other logic on them. How do I tell Excel to look for a string of exactly 32 characters in the data stream?

    So far, I am just able to loop through each line of output and ignore lines that start with a forward slash. This takes place after wscript.shell calls the executable and objStdOut is set

    While Not objStdOut.AtEndofStream
         strHASH=objStdOut.ReadLine     
              If Not InStr(1,strHASH,"/") = 1 Then ' this line now skip the lines of output that start with a slash
                 MsgBox strHASH
              End if
    Wend
    Any help figuring out how to grab the 32 character string and file name found in the 4th line of the output would be much appreciated.
    Last edited by wherbjr35@aol.com; 03-07-2014 at 08:32 PM. Reason: debugged further and got "ignore" to work

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Parse through pdf file via excel vba
    By Lloyd Blankfein in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-28-2012, 07:29 AM
  2. [SOLVED] four input single output logic problem
    By Hammer_757 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-11-2012, 02:02 PM
  3. Parse data from Excel to IE using VBA
    By AdriPaul in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2012, 02:53 AM
  4. Calculate output for the logic in the attached spreadhseet based on user input
    By tenn0228 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2009, 10:45 AM
  5. Replies: 5
    Last Post: 09-06-2008, 06:31 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1