Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Powershell: Search data in text file and export to CSV

$
0
0

I am trying to gather a specific number from a text file, then export that number to .csv.

For example, I have a text file called: log.txt under C:\data. When I open the file, It contents the words " UserData Size: 1014.288086 MB". I only need the number to shows in the CSV file, which is 1014.288086 in this case.

I wish someone can guide me the PowerShell scripts.

PS. I have attached an example Log text file so you can see the number I am looking to export. 

Thanks.


Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

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