I have two files for comparison which are extracts from set of xml files.
file1 has:
Comparing File: BRCSH1to320140224CC3.xml
:: TZZZ:BR
:: TAZZ:OUT
UIZZ:0 :: ERAZ:1.000000
UIZZ:0 :: CTZZ:B
UIZZ:0 :: CCAZ:MYR
Comparing File: BRMY20140224CC18REG013SPFNSY13.xml
:: TZZZ:BR
:: TAZZ:INB
UIZZ:1 :: ERAZ:1.000000
UIZZ:1 :: CTZZ:B
UIZZ:1 :: CCAZ:MYR
Comparing File: BRMY20140224CC19REG015DRTZ3.xml
:: TZZZ:BR
:: TAZZ:INB
UIZZ:1 :: ERAZ:1.000000
UIZZ:1 :: CTZZ:B
UIZZ:1 :: CCAZ:MYR
UIZZ:1 :: CTZZ:L
file2 has
To File: BRCSH1to320140224CC3.xml
:: TZZZ:BR
:: TAZZ:OUT
UIZZ:0 :: ERAZ:1.000000
UIZZ:0 :: CTZZ:B
To File: BRMY20140224CC19REG015DRTZ3.xml
:: TZZZ:BR
:: TAZZ:INB
UIZZ:1 :: ERAZ:1.000000
UIZZ:1 :: CTZZ:B
UIZZ:1 :: CCAZ:MYR
UIZZ:1 :: CTZZ:L
Now i'm getting results when the number of lines are equal in both the files with the below script.
diff -y source.txt target.txt | grep "|" | awk -F"[<|>]" '{ if( $1 ~ /^Comparing/ ) { print $1 $2} else { print "Expected value is:"$1 "Actual value is:" $2}}' >> Discrepancies.txt
But if I were to compare if the above is the file contents,I have to take what kind of implementation.