In Powershell, how to read and get as fast as possible the last line (or all the lines) which contains a specific string in a huge text file (about 200000 lines / 30 MBytes) ?
Have you tried:
gc myfile.txt | % { if($_ -match "my_string") {write-host $_}}
Or, you can create a "grep"-like function:
function grep($f,$s) { gc $f | % {if($_ -match $s){write-host $_}} }
Then you can just issue: grep $myfile.txt $my_string
grep $myfile.txt $my_string