none
how to export or convert robocopy log to excel

    Question

  • Hello

    I am using robocopy for moving files and folders from one location to another location and also generating log. I want to share the log with the end user, but log is not very user friendly.

    I want to export or convert robocopy to log to excel using powershell scrip, I found some articles to convert log summary to csv or excel, but could not be found on file details.

    How this can be done?

    Avian

    Friday, March 17, 2017 10:23 PM

All replies

  • Look in Gallery for a number of scripts that do this.


    \_(ツ)_/

    Friday, March 17, 2017 10:38 PM
  • I tried in Gallery, but did not found any script which fulfills my requirement.

    If you know some url, please share.

    Friday, March 17, 2017 11:13 PM
  • No but there are scripts that will show you how to parse a log file.

    You can also go here for many more scripts: https://www.google.com/?gws_rd=ssl#newwindow=1&q=powershell+convert+robocopy+logs&*&spf=69

    See this to set you expectations.


    \_(ツ)_/

    Friday, March 17, 2017 11:17 PM
  • Hi Jrv

    I already parsing robocopy log with sample file and able to generate html of Robocopy summary, but I am not able to generate HTML report of robocopy log list files.

    As far as expections concernt, I already knows this. I am not looking for complete code, just need some idea.

    Avian

    Friday, March 17, 2017 11:41 PM
  • What is stopping you from doing the remainder as HTML?  You need to ask a specific question and not just what you posted.

    The lines are variable depending on log options chosen then they are delimited by tabs and padded for display.  Just split the lines on the tab and trim each array element.

    You stated you wanted Excel output but now you are saying you want HTML.  Your question cannot be answered as asked.


    \_(ツ)_/


    • Edited by jrv Friday, March 17, 2017 11:48 PM
    Friday, March 17, 2017 11:47 PM
  • Sorry for confusion. I should not use HTML.

    Thanks for correction.

    Friday, March 17, 2017 11:54 PM
  • If you just want HTML then this will convert the log as displayable HTML.

    robocopy c:\test c:\test2 *.* /L /NP>robocopy.log
    Get-Content .\robocopy.log | 
    	ForEach-Object -Begin {'<div  style="color:red;width=800;background-color:antiquewhite;"><span>' } `
    					-Process { "$_<br/>" } `
    					-End {'</span></div>'} | 
    	Out-File robocopy.html
    . .\robocopy.html


    \_(ツ)_/

    Saturday, March 18, 2017 12:21 AM