3

File A

Table SAPSR3./1BEA/BBEA_BDH has no BasicFile LOB columns
Table SAPSR3./1BEA/BBEA_BDI has no BasicFile LOB columns
Table SAPSR3./1BEA/BBEA_DLI has no BasicFile LOB columns
Table SAPSR3./1BEA/CNPL_PDL has no BasicFile LOB columns
Table SAPSR3./1BEA/CNPL_PLH has no BasicFile LOB columns
Table SAPSR3./1BEA/CNPL_PLI has no BasicFile LOB columns
SAPSR3.RSEUMOD has more than 255 columns

File B

SAPSR3.TERCL2
SAPSR3.TERCL3
SAPSR3.CRM_ACE_UCC
SAPSR3.CRMIOBJCONT
SAPSR3.CRMORDERCONT
SAPSR3.CRMD_WEBREQ_CONT
SAPSR3.CRMIBASECONT
SAPSR3.CRMD_UIF_SYSINDX
SAPSR3.CRMISMCONT

I need to compare the 2nd column from FileA to FileB. If not found, I must print the entire line of fileA into new fileC otherwise (if found) then print the entire line along with concatenated string as "found".

Also from File B, the 1st column must be compared with FileA 2nd column. If not found ,then the result of searching this string (1st column of fileB) concatenated with "Need to be Analysed" must be printed into fileC.

1 Answer 1

4

use the amazing tool awk:

awk 'FNR==NR{a[$2]=$3;next}{print $0,a[$2]?a[$2]:"NeedToBeAnalayzed"}' fileA fileB > fileC
2
  • Thanks for your quick reply joseph, major modification on my query Commented Jun 7, 2014 at 15:17
  • My Query has a major modification done, pls. go through my question Joshep. Commented Jun 7, 2014 at 15:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .