Created
December 14, 2016 18:04
-
-
Save tostercx/dd7e9177055956afd25216ce0405396e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$test = @{}; | |
$out = New-Object System.Text.StringBuilder; | |
$lines = Get-Content 'f1.txt' | |
foreach ($line in $lines) { $test[$line] = 1; } | |
$lines = Get-Content 'f2.txt' | |
foreach ($line in $lines) { if($test[$line]) { $null = $out.Append("$line`r`n") } } | |
Set-Content out.txt $out.ToString() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment