I want to compare from fileA 2nd column values with rows of fileB . if that value is not present in fileB then write that value in other file. but only those value of fileA is compared with fileB whose fileA value of 1st column is greater and equal than 03.
eg 1st value picked up from file A "lieferungen" whose 1st column is 00 . so it will not be compare..
next value like "funny" whose 1st value 04 is greater than 3 so it is compared with fileB
as it is not present in file B . it is written in third file.
output
fileC
03 rasp
04 funny
05 done1
i have a huge database of more than 80000 records. plz help if it can be done using awk
this file is a csv with /t.
i want to find all values with the first column of this file in fileB and then check for in that line if the second column vvalues are present or not .
fileD is 1st content is of 1st column is "funny"
so funny would be checked in fileB if found then "funny" second column will be checked i.e mou1 will be checked in that line if present than ok. if not present than it will be written in other fileE.if first column of fileD is present than only second column of fileD is checked in that line .if first column field can be present in more than one rows in fileB all lines of fileB should be then compared with second column of fileD if found then not written ... if not found then written in fileE
so for
raspe mou4 : as raspe is not present in fileB it will be written in fileE as output
so
funny mou1
is present so it will not be written in fileE
next
funny mou2 is also present in fileB so not writen
now
raspe mou4
damn mou1 will be wriiten in fileE as it is not present in fileB.
o/p of fileE
funny mou1
funny mou2
can it be done using awk ... i have records more than 80000
---------- Post updated at 09:22 AM ---------- Previous update was at 08:52 AM ----------
hi kalpeer,
the code
grep -f fileB fileA | awk ' $1 >= 3' > fileC
is not working
as fileA contents may be present in a line of fileB(means in between of that line in fileB and not as a whole) but not vice versa..
means total line of fileB cannot be present in fileA
if fileB contains
2011890done1
3235235funny
so all those record which are greater than 3 and which are not present in fileB are to be redirected to third file.
eg : as in above file three records
03 rasp
04 alwaysisng
04 funny
05 done1
are greter than 3 . so rasp is compared to in each line of fileB . as rasp is present in any line of fileB .it is not redirrected in output file .. if rasp is not present in any line of fileB then it is redirected to output file . so output file for above will look like