Unique File Differences

I have the 2 files

File 1
ABC,1239800
BCED,890000
ABCKJK,66767

File 2
GUHJC,1239800
ABC,1239800
TYIO,5636

The thing is the no of values in file can exceed example ABC,1239800,4545465,AHHAH so i need to find those values in file 1 which do not match in File 2 so i should get ABCKJK,66767 and BCED,890000

Try:

awk -F, 'NR==FNR{A[$1];A[$2];next} !($1 in A || $2 in A)' file2 file1
BCED,890000
ABCKJK,66767

I have done this way

cut -f6,7 -d"|" file1  | sort -u > /tmp/FILE1_$$
cut -f6,7 -d"|" file2 | sort -u > /tmp/FILE2_$$"
comm -3 FILE2 FILE1 > /tmp/NEWFILE_$$

And does your method work in case the no of columns increase ?

[root@sistem1lnx tes1]# cat diff.sh
cat /dev/null > diffline.txt
while read line1
do
  var=0
  while read line2
  do
    if [ "$line1" = "$line2" ]
      then var=1
    fi
  done < file2
  if [ "$var" = "0" ]
    then echo $line1 >> diffline.txt
  fi
done < file1

[root@sistem1lnx tes1]# ./diff.sh

[root@sistem1lnx tes1]# more diff
diffline.txt  diff.sh

[root@sistem1lnx tes1]# more diffline.txt
BCED,890000
ABCKJK,66767

Something like this:

 
comm -23 File1 File2

Gives you the data present only in File1.

Make sure the files are sorted before doing this.

I tried with comm but i have a problem as i need to do a case sensitive search as well as non case sensitive how should i proceed ?

Then,

I would suggest you to use the "diff" command. Something like this:

 
diff -i File1 File2 | grep "<" | sed 's/^< //g'

Thanks i got it sorted