Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Combine and arrange text files

$
0
0

I am using the get-content and sort-object -unique cdmlets to combine text log files via:

(Get-Content .\*ninite.txt) | sort -unique | Set-Contentinstallreport.txt

Example text files are uploaded here.  The unique switch removes duplicates but it also rearranges the text lines.  I would like to have the single OK string be at the top of the lest in the final exported text file.  Do I need to save each line to a hash and rearrange that way first?


Viewing all articles
Browse latest Browse all 6937

Trending Articles