Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: To search and send "Interpretation (Interpret) Passed" Exactly from Html files  (Read 14337 times)

0 Members and 1 Guest are viewing this topic.

Venkat

    Topic Starter


    Rookie

    • Experience: Experienced
    • OS: Windows 7
    Hi Friends,
     I want a batch code to  search a string exactly like "Interpretation (Interpret) Passed" from a set of HTML files locatind in folders and subfolders and send the files which contain that string to another folder. similarly i wanna even search "Interpretation (Interpret) Failed" and "Interpretation (Interpret) Incomplete" from html files and send to specified folder.
    i tried with the code mentioned below:

    @echo OFF
    for /f "delims=" %%f in ('findstr /S/M /C:"Interpretation (Interpret) Failed" *.html') do copy "%%f" C:\\failedreports
    for /f "delims=" %%f in ('findstr /S/M /C:"Interpretation (Interpret) Incomplete" *.html') do copy "%%f" C:\incompletereports
    for /f "delims=" %%f in ('findstr /S/M "Interpretation (Interpret) Passed" *.html') do copy "%%f" C:\Passed

    But this code doesn't work .... Any Help Pls????????????????? ::) ::) :-\ ??? ??? ???
     Its very urgent Pls help me out :(
    Thanks in advance....

    Venkat

      Topic Starter


      Rookie

      • Experience: Experienced
      • OS: Windows 7
      Some1 pls help me out with this batch code pls,....

      I am really in need .......

      Thank you in advance.....

      foxidrive



        Specialist
      • Thanked: 268
      • Experience: Experienced
      • OS: Windows 8
      When you request some help in future - post once in a new thread, don't post PMs asking for help, and when you do get some help - come back and let the people here know if it worked or not.  That'd be good.


      Code: [Select]
      @echo off
      for /r %%a in (*.html) do findstr /C:"Interpretation (Interpret) Failed"     "%%a" >nul && copy "%%a" "C:\failedreports"
      for /r %%a in (*.html) do findstr /C:"Interpretation (Interpret) Incomplete" "%%a" >nul && copy "%%a" "C:\incompletereports"
      for /r %%a in (*.html) do findstr /C:"Interpretation (Interpret) Passed"     "%%a" >nul && copy "%%a" "C:\Passed"

      Allan

      • Moderator

      • Mastermind
      • Thanked: 1260
      • Experience: Guru
      • OS: Windows 10
      Post your question ONCE and in your own thread.

      patio

      • Moderator


      • Genius
      • Maud' Dib
      • Thanked: 1769
        • Yes
      • Experience: Beginner
      • OS: Windows 7
      And stop PM'ing people for answers Please...
      " Anyone who goes to a psychiatrist should have his head examined. "

      Squashman



        Specialist
      • Thanked: 134
      • Experience: Experienced
      • OS: Other
      And stop PM'ing people for answers Please...
      +1
      or maybe that is +2 or +3 already.

      patio

      • Moderator


      • Genius
      • Maud' Dib
      • Thanked: 1769
        • Yes
      • Experience: Beginner
      • OS: Windows 7
      Starting to sound alot more like Homework to me..... ::)
      " Anyone who goes to a psychiatrist should have his head examined. "

      Venkat

        Topic Starter


        Rookie

        • Experience: Experienced
        • OS: Windows 7
        Sorry all for the troble and thanks for the help... will let you people no if its working in a while since my server is down..
        « Last Edit: May 28, 2014, 11:23:40 PM by Venkat »

        Venkat

          Topic Starter


          Rookie

          • Experience: Experienced
          • OS: Windows 7
          Hi Foxi,

          The code that you suggested doesnt work . Its not copying anything, Any other suggestions ?

          Thanks in advance.

          foxidrive



            Specialist
          • Thanked: 268
          • Experience: Experienced
          • OS: Windows 8
          Place pause as the last line.

          Are there any messages on the screen?

          Venkat

            Topic Starter


            Rookie

            • Experience: Experienced
            • OS: Windows 7
            I tried as yo you said Foxi and also i get  many lines as mentioned below on the screen ...

            FINDSTR: Cannot open %



            foxidrive



              Specialist
            • Thanked: 268
            • Experience: Experienced
            • OS: Windows 8
            You pasted it into a cmd window, right?

            Squashman



              Specialist
            • Thanked: 134
            • Experience: Experienced
            • OS: Other
            I tried as yo you said Foxi and also i get  many lines as mentioned below on the screen ...

            FINDSTR: Cannot open %
            I don't get that error when I run it.

            patio

            • Moderator


            • Genius
            • Maud' Dib
            • Thanked: 1769
              • Yes
            • Experience: Beginner
            • OS: Windows 7
            He's done his own editing....

            Please post what you have so far...
            " Anyone who goes to a psychiatrist should have his head examined. "

            Squashman



              Specialist
            • Thanked: 134
            • Experience: Experienced
            • OS: Other
            He's done his own editing....

            Please post what you have so far...
            Another +1 for you!

            patio

            • Moderator


            • Genius
            • Maud' Dib
            • Thanked: 1769
              • Yes
            • Experience: Beginner
            • OS: Windows 7
             :P

            I'm savin em' all for future use...
            " Anyone who goes to a psychiatrist should have his head examined. "

            Venkat

              Topic Starter


              Rookie

              • Experience: Experienced
              • OS: Windows 7
              i have not edited anything, i am using this code as given by you as a batch file as "segregation.bat" and checking it by clicking on it, am i doing it right?  i ll send yo people the sample files for more clarity when i go to work  tomorrow! 

              anyways thanks for all the suggestions . . .

              Venkat

                Topic Starter


                Rookie

                • Experience: Experienced
                • OS: Windows 7
                i have got around 12500 test case file folders which have subfolders which contain these html files , and each test case gives the final output as "Interpretation (Interpret ) Passed" for passed test cases inside the html file , which can be searched as a search string ,
                so that all the failed , incomplete and passed  test cases move to appropriate folders specified ,

                This one wonderful batch code can segregate and separate all the passed , failed and incomplete test cases to appropriate folders !

                pls give some other  suggestions if possible . . .
                « Last Edit: May 29, 2014, 10:19:57 AM by Venkat »

                Squashman



                  Specialist
                • Thanked: 134
                • Experience: Experienced
                • OS: Other
                I tried as yo you said Foxi and also i get  many lines as mentioned below on the screen ...

                FINDSTR: Cannot open %
                Pretty sure that is not the whole error message. There should be something after the % symbol.
                And as Foxidrive has pointed out, if your were trying to run a single instance of the code from the command prompt instead of running it from the batch file and you didn't have the correct amount of % symbols you would get that error.

                Code: [Select]
                H:\>for /r %a in (*.html) do findstr /C:"Interpretation (Interpret) Failed"     "%%a" >nul && copy "%a" "C:\failedreports"

                H:\>findstr /C:"Interpretation (Interpret) Failed"     "%H:\FileZilla_2_2\GPL.html"   1>nul  && copy "H:\FileZilla_2_2\GPL.html" "C:\failedreports"
                FINDSTR: Cannot open %H:\FileZilla_2_2\GPL.html

                Squashman



                  Specialist
                • Thanked: 134
                • Experience: Experienced
                • OS: Other
                You would also get that error if the percent symbols were tripled in a batch file.
                Code: [Select]
                @echo off
                for /r %%a in (*.html) do findstr /C:"Interpretation (Interpret) Failed"     "%%%a" >nul && copy "%%a" "C:\failedreports"
                Code: [Select]
                H:\>foxi.bat
                FINDSTR: Cannot open %\failedreports

                DaveLembke



                  Sage
                • Thanked: 662
                • Certifications: List
                • Computer: Specs
                • Experience: Expert
                • OS: Windows 10
                Please copy/paste your batch here for us to look over again. Or save it as a txt file and submit it as an attachment for us to look over.

                *Also .... what OS Version are you using exactly with this? Windows 7 or 8 etc. If its not a typo which I believe it is then it might be something related to the OS version you are using, thats why I am asking.

                patio

                • Moderator


                • Genius
                • Maud' Dib
                • Thanked: 1769
                  • Yes
                • Experience: Beginner
                • OS: Windows 7
                Kinda what i asked for before...it's a shame that all those who request help here  get shy about posting their code...
                I'll never figure that out...
                " Anyone who goes to a psychiatrist should have his head examined. "

                Squashman



                  Specialist
                • Thanked: 134
                • Experience: Experienced
                • OS: Other
                If I had a nickel for everytime someone said they copy and pasted the code exactly and it didn't work but they actually didn't copy and paste it correctly I would be a rich man.

                foxidrive



                  Specialist
                • Thanked: 268
                • Experience: Experienced
                • OS: Windows 8
                If I had a nickel for everytime someone said they copy and pasted the code exactly and it didn't work but they actually didn't copy and paste it correctly I would be a rich man.

                I want another nickel for every person that introduced a typo error, or added an incorrect space, while editing sample code. :D

                Venkat

                  Topic Starter


                  Rookie

                  • Experience: Experienced
                  • OS: Windows 7
                  Hi ,
                   I am using windows 7 enterprise, i also checked the output through Windows Server R2 2008 enterprise and the result is the same as specified below:
                  I have attached the Batch file and the output i got for it is :

                  Quote
                  C:\Users\vk817719\Desktop\New folder>findstr /C:"Interpretation (Interpret) Fail
                  ed"     "C:\Users\vk817719\Desktop\New folder\20140123175007_BATCH_cvs_zzz_cliq
                  CR_45247\BATCH_cvs_zzz_cliq CR_45247_Report.html"   1>nul  && copy "C:\Users\vk8
                  17719\Desktop\New folder\20140123175007_BATCH_cvs_zzz_cliq CR_45247\BATCH_cvs_zz
                  z_cliq CR_45247_Report.html" "C:\Users\vk817719\Desktop\New folder\SegregatedRep
                  orts\failedreports"

                  C:\Users\vk817719\Desktop\New folder>findstr /C:"Interpretation (Interpret) Fail
                  ed"     "C:\Users\vk817719\Desktop\New folder\20140123175440_BATCH_cvs_zzzz45240
                  \BATCH_cvs_zzzz45240_Report.html"   1>nul  && copy "C:\Users\vk817719\Desktop\Ne
                  w folder\20140123175440_BATCH_cvs_zzzz45240\BATCH_cvs_zzzz45240_Report.html" "C:
                  \Users\vk817719\Desktop\New folder\SegregatedReports\failedreports"

                  C:\Users\vk817719\Desktop\New folder>findstr /C:"Interpretation (Interpret) Fail
                  ed"     "C:\Users\vk817719\Desktop\New folder\20140124013757_BATCH_cvs_24221-RAI
                  D10+1 to RAID6 with restripe\BATCH_cvs_24221-RAID10+1 to RAID6 with restripe_Rep
                  ort.html"   1>nul  && copy "C:\Users\vk817719\Desktop\New folder\20140124013757_
                  BATCH_cvs_24221-RAID10+1 to RAID6 with restripe\BATCH_cvs_24221-RAID10+1 to RAID
                  6 with restripe_Report.html" "C:\Users\vk817719\Desktop\New folder\SegregatedRep
                  orts\failedreports"

                  C:\Users\vk817719\Desktop\New folder>findstr /C:"Interpretation (Interpret) Fail
                  ed"     "C:\Users\vk817719\Desktop\New folder\20140124024603_BATCH_cvs_24269\BAT
                  CH_cvs_24269_Report.html"   1>nul  && copy "C:\Users\vk817719\Desktop\New folder
                  \20140124024603_BATCH_cvs_24269\BATCH_cvs_24269_Report.html" "C:\Users\vk817719\
                  Desktop\New folder\SegregatedReports\failedreports"

                  C:\Users\vk817719\Desktop\New folder>findstr /C:"Interpretation (Interpret) Fail
                  ed"     "C:\Users\vk817719\Desktop\New folder\20140124030811_BATCH_cvs_25649\BAT
                  CH_cvs_25649_Report.html"   1>nul  && copy "C:\Users\vk817719\Desktop\New folder
                  \20140124030811_BATCH_cvs_25649\BATCH_cvs_25649_Report.html" "C:\Users\vk817719\
                  Desktop\New folder\SegregatedReports\failedreports"

                  C:\Users\vk817719\Desktop\New folder>findstr /C:"Interpretation (Interpret) Fail
                  ed"     "C:\Users\vk817719\Desktop\New folder\20140124032357_BATCH_cvs_25695\BAT
                  CH_cvs_25695_Report.html"   1>nul  && copy "C:\Users\vk817719\Desktop\New folder
                  \20140124032357_BATCH_cvs_25695\BATCH_cvs_25695_Report.html" "C:\Users\vk817719\
                  Desktop\New folder\SegregatedReports\failedreports"

                  C:\Users\vk817719\Desktop\New folder>findstr /C:"Interpretation (Interpret) Fail
                  ed"     "C:\Users\vk817719\Desktop\New folder\20140124033820_BATCH_cvs_25701\BAT
                  CH_cvs_25701_Report.html"   1>nul  && copy "C:\Users\vk817719\Desktop\New folder
                  \20140124033820_BATCH_cvs_25701\BATCH_cvs_25701_Report.html" "C:\Users\vk817719\
                  Desktop\New folder\SegregatedReports\failedreports"
                  Quote

                  Pls review and let me no where i went wrong...

                  Nothing is getting copied seriously........

                  [recovering disk space, attachment deleted by admin]

                  foxidrive



                    Specialist
                  • Thanked: 268
                  • Experience: Experienced
                  • OS: Windows 8
                  Nothing is getting copied seriously........

                  Your screenshot doesn't have the error you mentioned - so something has changed.

                  It would seem that the files don't have the terms you are searching for.


                  Venkat

                    Topic Starter


                    Rookie

                    • Experience: Experienced
                    • OS: Windows 7
                    The Below example  is one of my Html file
                    Quote
                    Xweb Name: assignment11

                    --------------------------------------------------------------------------------

                    5/25/2014 7:26:10 PM Started Task_PowerNsms (fragment_start)
                    5/25/2014 7:26:10 PM MORDOR FRAGMENT INSERT BEGIN: C:\Batchmode\Assignments\Assignment11-VerifyOids\..\XwebFragments\4NSM_Setup.xml
                    5/25/2014 7:26:10 PM Turn ON all of the NSMs used in the OTP case
                    5/25/2014 7:26:22 PM Finished Task_PowerNsms (fragment_start) Passed
                    5/25/2014 7:26:22 PM Powering on NSMs 00:0C:29:78:B7:8A 172.31.148.95, 00:0C:29:EA:01:3A 172.31.148.96, 00:0C:29:A5:68:93 172.31.148.168, 00:0C:29:9E:D4:42 172.31.148.169 completed successfully
                    5/25/2014 7:26:24 PM Started Task_WaitForNsmUp (SetupB)
                    5/25/2014 7:26:24 PM Wait for all the of the NSMs to be up before proceeding
                    5/25/2014 7:26:28 PM Finished Task_WaitForNsmUp (SetupB) Passed
                    5/25/2014 7:26:28 PM Completed waiting for NSMs 172.31.148.95,172.31.148.96,172.31.148.168,172.31.148.169
                    5/25/2014 7:26:30 PM Started Task_SetupClient (SetupC)
                    5/25/2014 7:26:30 PM Clear persistent iSCSI targets, log out of all iSCSI targets, remove all or some iSCSI target portals on the client
                    5/25/2014 7:27:04 PM Finished Task_SetupClient (SetupC) Passed
                    5/25/2014 7:27:04 PM Successfully setup client(s): HOST004-01 (Windows2008R2) (IscsiClearPersistent:True IscsiLogoutAll:True IscsiRemoveAllTargetPortals:True )
                    5/25/2014 7:27:07 PM Started Task_AttachToGroup (SetupD)
                    5/25/2014 7:27:07 PM Attach to existing group
                    5/25/2014 7:28:08 PM Finished Task_AttachToGroup (SetupD) Passed
                    5/25/2014 7:28:08 PM Attached to group MG_ASSIGNMENT11
                    5/25/2014 7:28:10 PM Started Task_ClearGroup (SetupE)
                    5/25/2014 7:28:10 PM delete excess configuration in the management group
                    5/25/2014 7:29:04 PM Finished Task_ClearGroup (SetupE) Passed
                    5/25/2014 7:29:04 PM Successfully cleaned group MG_ASSIGNMENT11 (11.5.00.0649)
                    5/25/2014 7:29:06 PM Started Task_VerifyGroupNsms (SetupF)
                    5/25/2014 7:29:06 PM Verify all the NSMs that are supposed to be in this group are present
                    5/25/2014 7:29:08 PM Finished Task_VerifyGroupNsms (SetupF) Passed
                    5/25/2014 7:29:08 PM All expected NSMs are in the MG MG_ASSIGNMENT11 (11.5.00.0649). There are not extras and none are missing. VSA3-StrgNode3 172.31.148.168 (00:0C:29:A5:68:93),VSA4-StrgNode4 172.31.148.169 (00:0C:29:9E:D4:42),VSA1-StrgNode1 172.31.148.95 (00:0C:29:78:B7:8A),VSA2-StrgNode2 172.31.148.96 (00:0C:29:EA:01:3A)
                    5/25/2014 7:29:11 PM Started Task_SetNsmOtp (OTP1)
                    5/25/2014 7:29:11 PM Disable the OTP
                    5/25/2014 7:29:25 PM Finished Task_SetNsmOtp (OTP1) Passed
                    5/25/2014 7:29:25 PM Successfully disabled OTP on 172.31.148.95)
                    5/25/2014 7:29:27 PM Started Task_SetNsmOtp (OTP2)
                    5/25/2014 7:29:27 PM Disable the OTP
                    5/25/2014 7:29:42 PM Finished Task_SetNsmOtp (OTP2) Passed
                    5/25/2014 7:29:42 PM Successfully disabled OTP on 172.31.148.96)
                    5/25/2014 7:29:44 PM Started Task_SetNsmOtp (OTP3)
                    5/25/2014 7:29:44 PM Disable the OTP
                    5/25/2014 7:29:58 PM Finished Task_SetNsmOtp (OTP3) Passed
                    5/25/2014 7:29:58 PM Successfully disabled OTP on 172.31.148.168)
                    5/25/2014 7:30:00 PM Started Task_SetNsmOtp (OTP4)
                    5/25/2014 7:30:00 PM Disable the OTP
                    5/25/2014 7:30:14 PM Finished Task_SetNsmOtp (OTP4) Passed
                    5/25/2014 7:30:14 PM Successfully disabled OTP on 172.31.148.169)
                    5/25/2014 7:30:17 PM Started Task_WaitTime (CompleteSetup)
                    5/25/2014 7:30:17 PM Check the storage health status.
                    5/25/2014 7:30:22 PM Finished Task_WaitTime (CompleteSetup) Passed
                    5/25/2014 7:30:22 PM Waited for 3 seconds
                    5/25/2014 7:30:25 PM Started Task_ConfigureManagers (fragment_end)
                    5/25/2014 7:30:25 PM END MANDATORY SETUP
                    5/25/2014 7:30:25 PM MORDOR FRAGMENT INSERT END: C:\Batchmode\Assignments\Assignment11-VerifyOids\..\XwebFragments\4NSM_Setup.xml
                    5/25/2014 7:30:25 PM Start manager on the specified NSMs
                    5/25/2014 7:30:35 PM Finished Task_ConfigureManagers (fragment_end) Passed
                    5/25/2014 7:30:35 PM Configured managers VSA3-StrgNode3 172.31.148.168 (00:0C:29:A5:68:93),VSA1-StrgNode1 172.31.148.95 (00:0C:29:78:B7:8A),VSA2-StrgNode2 172.31.148.96 (00:0C:29:EA:01:3A) in MG_ASSIGNMENT11 (11.5.00.0649)
                    5/25/2014 7:30:37 PM Started Task_CreateCluster (11T1A)
                    5/25/2014 7:30:37 PM Step 1: 1. Create a MG with 4 NSMs (NSM1, NSM2, NSM3, NSM4). 2. Create a cluster with all the four NSMs. 3. Configure SNMP General settings. 4. Configure SNMP Trap settings. 5. Configure MIB browser on Windows client to receive SNMP Traps from the CMC.//No task Expected Result: Environment should be ready for test. Record the details of the test ring used to execute this test - Windows versions, CMC version, LeftHand OS version etc.
                    5/25/2014 7:30:37 PM Step1: 2. Create a cluster with all the four NSMs.
                    5/25/2014 7:30:37 PM Create cluster with all the 4 NSMs and assign VIP
                    5/25/2014 7:30:44 PM Finished Task_CreateCluster (11T1A) Passed
                    5/25/2014 7:30:44 PM Created cluster cluster1 with VSA1-StrgNode1 172.31.148.95 (00:0C:29:78:B7:8A),VSA2-StrgNode2 172.31.148.96 (00:0C:29:EA:01:3A),VSA3-StrgNode3 172.31.148.168 (00:0C:29:A5:68:93),VSA4-StrgNode4 172.31.148.169 (00:0C:29:9E:D4:42)in group MG_ASSIGNMENT11 (11.5.00.0649)
                    5/25/2014 7:30:47 PM Started Task_CreateSnmpAccessControl (11T1B)
                    5/25/2014 7:30:47 PM Step1: 3. Configure SNMP General settings.
                    5/25/2014 7:30:47 PM Configure SNMP General settings.
                    5/25/2014 7:31:04 PM Finished Task_CreateSnmpAccessControl (11T1B) Passed
                    5/25/2014 7:31:04 PM Added the ipaddress'172.31.148.94' in access control.
                    5/25/2014 7:31:06 PM Started Task_StartGroupSnmpTrapCollection (11T1C)
                    5/25/2014 7:31:06 PM Step1: 4. Configure SNMP Trap settings.
                    5/25/2014 7:31:06 PM Configure Events and Alerts to begin the alerts and events collection through SNMP
                    5/25/2014 7:31:39 PM Finished Task_StartGroupSnmpTrapCollection (11T1C) Passed
                    5/25/2014 7:31:39 PM Started SNMP collection
                    5/25/2014 7:31:42 PM Started Task_TestStep (T1_RESULT)
                    5/25/2014 7:31:42 PM Running Tests using RunTestCLI
                    5/25/2014 7:31:45 PM Finished Task_TestStep (T1_RESULT) Passed
                    5/25/2014 7:31:45 PM Task_TestStep: All passed:
                    Task UID:11T1A had expected status (Passed)
                    Task UID:11T1B had expected status (Passed)
                    Task UID:11T1C had expected status (Passed)
                    5/25/2014 7:31:47 PM Started Task_VerifySnmpMibVariables (50536T3A)
                    5/25/2014 7:31:47 PM Step 2: From Windows Server, 1. Open MIB Browser. 2. Enter the IP address of the coordinating manager NSM of the MG(as shown in CMC MG details summary) in the 'Address' field of the MIB Browser. 3. Click on 'Advanced' button and enter the string that is set in CMC (i.e 'public' in this case) in both 'Read Community' and 'Write Community' fields. 4. Load the below given MIB files for the latest LeftHand OS, LEFTHAND-NETWORKS-GLOBAL-REG-MIB, LEFTHAND-NETWORKS-NSM-MIB and LEFTHAND-NETWORKS-NSM-STORAGE-MIB from C:\Program Files\HP\StoreVirtual\UI\mibs location. Note: If CMC is installed on user defined location then MIBs should be loaded from that location. Expected Result: 1. MIB Browser should get opened without any error. 2. NSM IP should get added in the 'Address' field. 3. Community string should get added in both 'Read Community' and 'Write Community' fields. 4. MIBs should get loaded without error. (Note:To be done manually)
                    5/25/2014 7:31:47 PM Simulate the specified event on NSM1=EID_BBU_FAULTY
                    5/25/2014 7:31:47 PM testcase id=50536
                    5/25/2014 7:31:47 PM Verify OID: SNMP storageDeviceClass in MIB Browser
                    5/25/2014 7:31:50 PM Finished Task_VerifySnmpMibVariables (50536T3A) Passed
                    5/25/2014 7:31:50 PM Succeeded to verify Snmp Mib Variables: storageDeviceClass.1=virtual Verified Variables: storageDeviceClass.1: 'Virtual '.
                    5/25/2014 7:31:52 PM Started Task_VerifyNsmDiskProperties (50536T3B)
                    5/25/2014 7:31:52 PM testcase id=50536
                    5/25/2014 7:31:52 PM This task will verify NSM device capacity reported by Hydra and SNMP are consistent with what the user has specified
                    5/25/2014 7:32:06 PM Finished Task_VerifyNsmDiskProperties (50536T3B) Passed
                    5/25/2014 7:32:06 PM Task_VerifyNsmDiskProperties: All passed: 172.31.148.95/Disk 1/InterfaceType has the value "virtual"
                    5/25/2014 7:32:08 PM Started Task_VerifySnmpMibVariables (50545T3C)
                    5/25/2014 7:32:08 PM testcase id=50545
                    5/25/2014 7:32:08 PM Verify OID: SNMP storageDeviceCount in MIB Browser
                    5/25/2014 7:32:11 PM Finished Task_VerifySnmpMibVariables (50545T3C) Passed
                    5/25/2014 7:32:11 PM Succeeded to verify Snmp Mib Variables: storageDeviceCount=1 Verified Variables: storageDeviceCount: '1'.
                    5/25/2014 7:32:13 PM Started Task_VerifyNsmRaidProperties (50545T3D)
                    5/25/2014 7:32:13 PM testcase id=50545
                    5/25/2014 7:32:13 PM This task will verify NSM device class reported by Hydra and SNMP are consistent with what the user has specified
                    5/25/2014 7:32:29 PM Finished Task_VerifyNsmRaidProperties (50545T3D) Passed
                    5/25/2014 7:32:29 PM Task_VerifyNsmRaidProperties: All passed: 172.31.148.95/ Raid index = 0/DiskCount matches the expected value "1"
                    5/25/2014 7:32:32 PM Started Task_VerifySnmpMibVariables (50546T3E)
                    5/25/2014 7:32:32 PM testcase id=50546
                    5/25/2014 7:32:32 PM Verify OID: SNMP storageDeviceFirmwareVersion in MIB Browser
                    5/25/2014 7:32:34 PM Finished Task_VerifySnmpMibVariables (50546T3E) Passed
                    5/25/2014 7:32:34 PM Succeeded to verify Snmp Mib Variables: storageDeviceFirmwareVersion.1=1.0 Verified Variables: storageDeviceFirmwareVersion.1: '1.0'.
                    5/25/2014 7:32:37 PM Started Task_VerifyNsmDiskProperties (50546T3F)
                    5/25/2014 7:32:37 PM testcase id=50546
                    5/25/2014 7:32:37 PM This task will verify NSM device class reported by Hydra and SNMP are consistent with what the user has specified
                    5/25/2014 7:32:50 PM Finished Task_VerifyNsmDiskProperties (50546T3F) Passed
                    5/25/2014 7:32:50 PM Task_VerifyNsmDiskProperties: All passed: 172.31.148.95/Disk 1/FirmwareVersion has the value "1.0"
                    5/25/2014 7:32:53 PM Started Task_VerifySnmpMibVariables (50558T3G)
                    5/25/2014 7:32:53 PM testcase id=50558
                    5/25/2014 7:32:53 PM Verify OID: SNMP storageDeviceLabel in MIB Browser
                    5/25/2014 7:32:55 PM Finished Task_VerifySnmpMibVariables (50558T3G) Passed
                    5/25/2014 7:32:55 PM Succeeded to verify Snmp Mib Variables: storageDeviceLabel.1=1 Verified Variables: storageDeviceLabel.1: '1'.
                    5/25/2014 7:32:58 PM Started Task_VerifyNsmDiskProperties (50558T3H)
                    5/25/2014 7:32:58 PM testcase id=50558
                    5/25/2014 7:32:58 PM This task will verify NSM device class reported by Hydra and SNMP are consistent with what the user has specified
                    5/25/2014 7:33:12 PM Finished Task_VerifyNsmDiskProperties (50558T3H) Passed
                    5/25/2014 7:33:12 PM Task_VerifyNsmDiskProperties: All passed: 172.31.148.95/Disk 1/Label has the value "1"
                    5/25/2014 7:33:14 PM Started Task_VerifySnmpMibVariables (50559T3I)
                    5/25/2014 7:33:14 PM testcase id=50559
                    5/25/2014 7:33:14 PM Verify OID: SNMP storageDeviceHotRemovable in MIB Browser
                    5/25/2014 7:33:17 PM Finished Task_VerifySnmpMibVariables (50559T3I) Passed
                    5/25/2014 7:33:17 PM Succeeded to verify Snmp Mib Variables: storageDeviceHotRemovable.1=2 Verified Variables: storageDeviceHotRemovable.1: '2'.
                    5/25/2014 7:33:19 PM Started Task_VerifySnmpMibVariables (50560T3J)
                    5/25/2014 7:33:19 PM testcase id=50560
                    5/25/2014 7:33:19 PM Verify OID: SNMP storageDeviceModel in MIB Browser
                    5/25/2014 7:33:22 PM Finished Task_VerifySnmpMibVariables (50560T3J) Passed
                    5/25/2014 7:33:22 PM Succeeded to verify Snmp Mib Variables: storageDeviceModel.1=Virtual disk Verified Variables: storageDeviceModel.1: 'Virtual disk'.
                    5/25/2014 7:33:24 PM Started Task_VerifyNsmDiskProperties (50560T3K)
                    5/25/2014 7:33:24 PM testcase id=50560
                    5/25/2014 7:33:24 PM This task will verify NSM device class reported by Hydra and SNMP are consistent with what the user has specified
                    5/25/2014 7:33:38 PM Finished Task_VerifyNsmDiskProperties (50560T3K) Passed
                    5/25/2014 7:33:38 PM Task_VerifyNsmDiskProperties: All passed: 172.31.148.95/Disk 1/Model has the value "Virtual disk"
                    5/25/2014 7:33:40 PM Started Task_TestStep (T3_RESULT)
                    5/25/2014 7:33:40 PM Running Tests using RunTestCLI
                    5/25/2014 7:33:43 PM Finished Task_TestStep (T3_RESULT) Passed
                    5/25/2014 7:33:43 PM Task_TestStep: All passed:
                    Task UID:50536T3A had expected status (Passed)
                    Task UID:50536T3B had expected status (Passed)
                    Task UID:50545T3C had expected status (Passed)
                    Task UID:50545T3D had expected status (Passed)
                    Task UID:50546T3E had expected status (Passed)
                    Task UID:50546T3F had expected status (Passed)
                    Task UID:50558T3G had expected status (Passed)
                    Task UID:50558T3H had expected status (Passed)
                    Task UID:50559T3I had expected status (Passed)
                    Task UID:50560T3J had expected status (Passed)
                    Task UID:50560T3K had expected status (Passed)
                    5/25/2014 7:33:45 PM Started Task_ClearGroup (CleanupA)
                    5/25/2014 7:33:45 PM delete excess configuration in the management group
                    5/25/2014 7:35:25 PM Finished Task_ClearGroup (CleanupA) Passed
                    5/25/2014 7:35:25 PM Successfully cleaned group MG_ASSIGNMENT11 (11.5.00.0649)
                    5/25/2014 7:35:28 PM Started Interpretation (Interpret)
                    5/25/2014 7:35:28 PM check that all the tasks complete with expected result
                    5/25/2014 7:35:30 PM Finished Interpretation (Interpret) Passed
                    5/25/2014 7:35:30 PM Interpretation: All passed:
                    Task UID:11T1A had expected status (Passed)
                    Task UID:11T1B had expected status (Passed)
                    Task UID:11T1C had expected status (Passed)
                    Task UID:50536T3A had expected status (Passed)
                    Task UID:50536T3B had expected status (Passed)
                    Task UID:50545T3C had expected status (Passed)
                    Task UID:50545T3D had expected status (Passed)
                    Task UID:50546T3E had expected status (Passed)
                    Task UID:50546T3F had expected status (Passed)
                    Task UID:50558T3G had expected status (Passed)
                    Task UID:50558T3H had expected status (Passed)
                    Task UID:50559T3I had expected status (Passed)
                    Task UID:50560T3J had expected status (Passed)
                    Task UID:50560T3K had expected status (Passed)
                    5/25/2014 7:35:33 PM Started Exit (exit)
                    5/25/2014 7:35:33 PM Run=30, pass=30, fail=0, incomplete=0
                    5/25/2014 7:35:33 PM Passing percentage is 100.0 %
                    5/25/2014 7:35:33 PM Duration: 00:09:25.2343750
                    5/25/2014 7:35:33 PM Finished Test run TestRun Passed
                    5/25/2014 7:35:33 PM
                    --------------------------------------------------------------------------------


                    the bolded font is my search string which differntiates from the failed and incomplete testcases.

                    foxidrive



                      Specialist
                    • Thanked: 268
                    • Experience: Experienced
                    • OS: Windows 8
                    Try one that has Interpretation (Interpret) Failed in it.  That's the part you were showing.

                    Actually: get three files - one with each search term inside the file - then run the code in that folder.

                    Another question: do you need to copy or move these files?  Moving will be far faster.
                    « Last Edit: May 30, 2014, 02:18:51 AM by foxidrive »

                    Venkat

                      Topic Starter


                      Rookie

                      • Experience: Experienced
                      • OS: Windows 7
                      I tried that also :( But it aint working.........


                      But Seriously Thanks for the help....:)


                      I will try again with some other logic and post it if i find an alternative .....

                      foxidrive



                        Specialist
                      • Thanked: 268
                      • Experience: Experienced
                      • OS: Windows 8
                      Here, run this in an empty folder and you'll see that it works.  I have no idea what you are doing, but something you've done or failed to do is the problem.

                      Code: [Select]
                      @echo off
                      >failed.html echo %date% Interpretation (Interpret) Failed %time
                      >incomplete.html echo %date% Interpretation (Interpret) Incomplete %time
                      >passed.html echo %date% Interpretation (Interpret) Passed %time


                      for /r %%a in (*.html) do findstr /C:"Interpretation (Interpret) Failed"     "%%a" >nul && echo copy "%%a" "C:\failedreports"
                      for /r %%a in (*.html) do findstr /C:"Interpretation (Interpret) Incomplete" "%%a" >nul && echo copy "%%a" "C:\incompletereports"
                      for /r %%a in (*.html) do findstr /C:"Interpretation (Interpret) Passed"     "%%a" >nul && echo copy "%%a" "C:\Passed"

                      pause

                      Venkat

                        Topic Starter


                        Rookie

                        • Experience: Experienced
                        • OS: Windows 7
                        Hi Foxi ,

                        Thanks a lot for the code, i no that
                        Quote
                        your code is perfect but unfortunately the same code is not working for me
                        , might be i need to change some settings in my system or it might be due to the version of my OS(Windows 7 enterprise) ,

                        i think some service is stopping this operation in the backend, should i start or stop some service in "services.msc" to get this issue resolved or is this some problem with the OS?

                        Squashman



                          Specialist
                        • Thanked: 134
                        • Experience: Experienced
                        • OS: Other
                        I tried as yo you said Foxi and also i get  many lines as mentioned below on the screen ...

                        FINDSTR: Cannot open %
                        1) Explain why you are no nonger getting this error? Obviously you changed something because you are no longer getting that error in the output you showed us.
                        2) What drive letter and folder is the batch file executing from?
                        3) Do the output folders exist?

                        Squashman



                          Specialist
                        • Thanked: 134
                        • Experience: Experienced
                        • OS: Other
                        The Change Directory & Copy commands in your batch file does not match the paths in the executing output.
                        Your code:
                        Code: [Select]
                        cd C:\New folder
                        copy "%%a" "C:\New folder\SegregatedReports\failedreports"
                        Your output:
                        Code: [Select]
                        C:\Users\vk817719\Desktop\New folder>findstr /C:"Interpretation (Interpret) Fail
                        ed"     "C:\Users\vk817719\Desktop\New folder\20140123175007_BATCH_cvs_zzz_cliq
                        CR_45247\BATCH_cvs_zzz_cliq CR_45247_Report.html"   1>nul  && copy "C:\Users\vk8
                        17719\Desktop\New folder\20140123175007_BATCH_cvs_zzz_cliq CR_45247\BATCH_cvs_zz
                        z_cliq CR_45247_Report.html" "C:\Users\vk817719\Desktop\New folder\SegregatedRep
                        orts\failedreports"

                        C:\Users\vk817719\Desktop\New folder>findstr /C:"Interpretation (Interpret) Fail
                        ed"     "C:\Users\vk817719\Desktop\New folder\20140123175440_BATCH_cvs_zzzz45240
                        \BATCH_cvs_zzzz45240_Report.html"   1>nul  && copy "C:\Users\vk817719\Desktop\Ne
                        w folder\20140123175440_BATCH_cvs_zzzz45240\BATCH_cvs_zzzz45240_Report.html" "C:
                        \Users\vk817719\Desktop\New folder\SegregatedReports\failedreports"
                        « Last Edit: May 30, 2014, 07:22:57 AM by Squashman »

                        Venkat

                          Topic Starter


                          Rookie

                          • Experience: Experienced
                          • OS: Windows 7
                          Hi Foxi and Team :)

                          Good News:)
                          The Final code which worked for me is :
                          Quote
                          @echo on
                          cd C:\Mordor\Reports
                          for /r %%a in (*.html) do findstr /C:"Interpretation (Interpret)</strong> <span style='font-weight: bold; color:red'>Failed"        "%%a" >nul && copy "%%a" "C:\Mordor\Reports\SegregatedReports\failedreports"
                          for /r %%a in (*.html) do findstr /C:"Interpretation (Interpret)</strong> <span style='font-weight: bold; color:yellow'>Incomplete" "%%a" >nul && copy "%%a" "C:\Mordor\Reports\SegregatedReports\incompletereports"
                          for /r %%a in (*.html) do findstr /C:"Interpretation (Interpret)</strong> <span style='font-weight: bold; color:green'>Passed"      "%%a" >nul && copy "%%a" "C:\Mordor\Reports\SegregatedReports\Passed"
                          pause

                          Quote
                          The Actual problem was with the search string and all of us forgot that HTML content at the backend is different and batch code runs at the backend!!!!! and it was totally my silliness :P

                          Quote
                          Foxi U r the best Batch coder -Real GURU ;D :D

                          Squashman



                            Specialist
                          • Thanked: 134
                          • Experience: Experienced
                          • OS: Other
                          Yes without seeing your actual HTML files we would have no idea that you were doing any type of formatting to your TEXT.
                          But instead of hardcoding all that you could have just used a regular expression.
                          Code: [Select]
                          findstr /R /C:"Interpretation (Interpret).*Failed"