Link to home
Start Free TrialLog in
Avatar of dfn48
dfn48

asked on

Compare two different files

I need to compare the difference in contexts or labels stored in brackets in two different files.  

For example:

OLDFILE                                                                           NEWFILE                                                       Result

[AMILX_UATS_DETAIL]                                    [AMILX_UATS_DETAIL]                                     [AMCSmartk__prod_kE]                                                                              
Driver=/mssql/sqls555/S0sql55.so              Driver=/mssql/sqls555/S0sql55.so
Description=DataDirect access Protoc        Description=DataDirect access Protoc

[AMILX_TSTS_DE]                                            [AMILX_TSTS_DE]
Driver=/mssql/sqls555/S0sql55.so              Driver=/mssql/sqls555/S0sql55.so
Description=DataDirect access Protoc       Description=DataDirect access Protoc

[AMCSmartk__prod_kE]
Driver=/mssql/sqls555/S0sql55.so
Description=DataDirect access Protoc


Here is my program:
#!/bin/bash

sdiff OLDFILE.txt  NEWFILE.txt |sed [^ '<']  >Result.out

Open in new window

Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

What is your question exactly? Can you post the output that you want to get? Is your program working or not?
ASKER CERTIFIED SOLUTION
Avatar of simon3270
simon3270
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dfn48
dfn48

ASKER

thanks