Afternoon guys,
I have 2 files, 1.txt and 2.txt containing employee numbers.
the 1st file (1.txt) is an extract from sybase with active employee numbers, the 2nd (2.txt) is a scan from the sybase log containing successfull logins *** which i have already mined and now contains only employee numbers as well***
I need to find employee numbers that are active but have not logged in, thus i am looking for values withing 1.txt that are not in 2.txt and output this to 3.txt.
I have tried "diff", "comm", awk and a for loop below without success.
#! /bin/sh
awk '
FILENAME=="2.txt" { arr[$0]++}
FILENAME=="1.txt" { if (arr[$0]==0) {print $0} }'
2.txt 1.txt 3.txt
for x in 'cat 1.txt'; do
grep $x 2.txt > test.txt ;
done
Hopefully you guys could please help me out.