Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- .synopsis
- Get the content of a text file, e.g. http://norvig.com/big.txt - 6.5MB
- From that content, copy to an array every record that has "t" at location 21 (offset 0)
- Count the records in that array
- #>
- $fullContent = Get-Content -Path C:\temp\big.txt
- $fullContent.Count
- $filteredContent = @()
- $fullContent | foreach {
- if ($_[21] -eq "t") {
- $filteredContent += $_
- }
- }
- $filteredContent
- $filteredContent.Count
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement