Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You could also use either of these:

  (Select-String "pattern" -Path file.txt).Line > t.txt
  Select-String "Pattern" -Path file.txt | Select-Object -ExpandProperty Line > t.txt
Or equivalent to the second example but with shortcuts:

  sls pattern -path file.txt | select -exp line > t.txt


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: