Powershell using Robocopy to list files in csv
<p>I have been asked to provide a listing of all files in a folder and its subfolders.</p>

<p>Initial efforts using powershell and dos commands proved it was unable to cope with file and folder names that exceeded windows 256 character length limit so I decided I had to use robocopy to get a listing of all files.</p>

<p>This worked great but output is logged in a text file. Most of the output is tab delimited so I have figured out a way to convert this to a csv.</p>

<p>The problem I am having is there is a space between the file size and the date. After conversion to csv the "filesize, date and time" all exists within the same column when the csv is opened in excel. I dont mind the date and time being in the same column but I need fileszie to be in its own column.</p>

<p>So the question is, how can I replace the space between filesize and date with ","  (including the doublequotes) using a powershell command.</p>

<p>I cannot replace all spaces as there might be spaces in some of the file name</p>

<p>Hope I have explained this as clearly as possible.</p>

<p>TIA</p>