Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Sort text file contents by date

$
0
0

Hi 

I have a text file that contains dates and data  I need to sort the contents of the text file so with the most recent date being listed 1st /ordered from most recent down

I would use get-content  to import the content of the text file into  a variable but I'm sure of what approach/cmdlets to use next

e.g.   Below   

Example.txt

1/1/2016 16:00 Server1

1/1/2014 17:00 Server3

2/2/2019 18:00 Server5

2/2/2015 19:00 Server4



confuseis


Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>