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 14220 times)

0 Members and 1 Guest are viewing this topic.

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"