View Single Post
Old 10-13-2008   #2 (permalink)
David Moravec
Guest


 
 

RE: Compare files and get the differential

Hi,
just small ping (haven't time now to test it whole):

$a = "pc001","pc002"
$b = "pc001","pc002","pc003"
Compare-Object $a $b

Output:

InputObject SideIndicator
----------- -------------
pc003 =>

I am sure you can pipe it to the file.

David

"IT Staff" wrote:
Quote:

> I've 2 text files.
>
> Eg file1.txt
> pc001
> pc002
> ...etc
>
> File2.txt
> pc001
> pc002
> pc003
> ...etc
>
> Extract only the differences eg pc003 and output to another file.
>
> Is there a compare function in .net ?
>
>
>
My System SpecsSystem Spec