[/CODE]Dear All,
I am having a requirement to find the difference between 2 files and generate a discrepancy report out of it as an html page. I prefer using diff -y file1 file2 since it gives user friendly layout to know any discrepancy in the record and unique records among the 2 file. Here's how it looks like.
File1:
ABCD*DEFG~
HI*JK~
LMN*OP~
File2:
ABCD*DEFG~
HIH*JK~
LMN*OP~
FGH*NM~
Output is :
ABCD*DEFG~ ABCD*DEFG~
HI*JK~ | HIH*JK~
> XY*Z~
LMN*OP~ LMN*OP~
> FGH*NM~
I need to replace the lines that has bad data with html tags as prefix and suffix w/o altering the inundation of the output
ABCD*DEFG~ ABCD*DEFG~
<font color="red">HI*JK~ | HIH*JK~</font>
<font color="red"> > XY*Z~</font>
LMN*OP~ LMN*OP~
<font color="red"> > FGH*NM~</font>
I am not able to use | and > as FS or delimiter in awk or sed since my actual files might also contain such characters. Please suggest me the best solution to overcome this challenge.