Remove Top Line of Text File with PowerShell

后端 未结 10 1242
误落风尘
误落风尘 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:22

    Another approach to remove the first line from file, using multiple assignment technique. Refer Link

     $firstLine, $restOfDocument = Get-Content -Path $filename 
     $modifiedContent = $restOfDocument 
     $modifiedContent | Out-String | Set-Content $filename
    

提交回复
热议问题