Skip to content

Instantly share code, notes, and snippets.

@deldersveld
Created January 12, 2018 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deldersveld/2b8f61bf08095812ccb02a426f30c193 to your computer and use it in GitHub Desktop.
Save deldersveld/2b8f61bf08095812ccb02a426f30c193 to your computer and use it in GitHub Desktop.
$getFirstLine = $true
get-childItem "[path]\*.tsv" | foreach {
$filePath = $_
$lines = $lines = Get-Content $filePath
$linesToWrite = switch($getFirstLine) {
$true {$lines}
$false {$lines | Select -Skip 1}
}
$getFirstLine = $false
Add-Content "[outputpath]\[filename].tsv" $linesToWrite
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment