How can I make this PowerShell script parse large files faster?

后端 未结 3 641
名媛妹妹
名媛妹妹 2020-12-01 12:58

I have the following PowerShell script that will parse some very large file for ETL purposes. For starters my test file is ~ 30 MB. Larger files around 200 MB are

3条回答
  •  长情又很酷
    2020-12-01 13:46

    This is almost a non-answer...I love PowerShell...but I will not use it to parse log files, especially large log files. Use Microsoft's Log Parser.

    C:\>type input.txt | logparser "select substr(field1,1) from STDIN" -i:TSV -nskiplines:14 -headerrow:off -iseparator:spaces -o:tsv -headers:off -stats:off
    

提交回复
热议问题