CMD or Powershell command to combine (merge) corresponding lines from two files [duplicate]

In PowerShell, and assuming both files have exactly the same number of lines:

$f1 = Get-Content file1
$f2 = Get-Content file2

for ($i = 0; $i -lt $f1.Length; ++$i) {
  $f1[$i] + "`t" + $f2[$i]
}

Leave a Comment