Remove Top Line of Text File with PowerShell

后端 未结 10 1257
误落风尘
误落风尘 2020-12-01 11:51

I am trying to just remove the first line of about 5000 text files before importing them.

I am still very new to PowerShell so not sure what to search for or how to

10条回答
  •  我在风中等你
    2020-12-01 12:19

    It is not the most efficient in the world, but this should work:

    get-content $file |
        select -Skip 1 |
        set-content "$file-temp"
    move "$file-temp" $file -Force
    

提交回复
热议问题