scripting - removing extra spaces in powershell -


I want to use powershell to remove unnecessary spaces and replace between those entries with a comma so that I can change the results for further analysis in a functioning CSV.

This is my code;

  go-content -path c: \ user \ username \ desktop \ results.txt | {$ _-Replace "\ s +" ""} for e-object. Out-File - File Path C: \ User \ Username \ Desktop \ results.csv  

Initial Resets are like this

  Entry Entry Entry (All <5 p>  

/ Div>

You were closest but you would not have been "," instead of "" Need to replace it with your text files The bike is like the following. I do not know if you mean that the major / trailing place is there, but it is okay.

"Entry entry entry"

  Go-content-path C: \ user \ username \ desktop \ results.txt | {$ _ For e-objects. Trim () - "\ s +" "," "|" | Out-File-File-Path C: \ User \ User Name \ Desktop \ results.csv-encoding ascii  

$ _ trim () - "\ s +" "," Use the trim to remove the outer spaces to prevent excess values ​​in the / code> CSV.

Let me know if I have changed your question incorrectly.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -