Attached is a file called diff.txt
It is the output from this command:
diff -y --suppress-common-lines --width=5000 1.txt 2.txt > diff.txt
I have also attached 1.txt and 2.txt for your convenience.
Both 1.txt and 2.txt contain one very long CSV string.
File 1.txt is a CSV dump of one DB record before changes
File 2.txt is a CSV dump of the same DB record after it was altered
The table fields are: id, t_client, t_filelocation, t_remotescript, t_destination, t_enabled, t_search, t_compression
I want to find "exactly" (down to the charaters) of what was changed in 2.txt.
I can tell you; for your results should you take on this task; is that 2.txt contains these extra characters sequencially:
<where>newgjv<yesterday>
So what I need to do:
1. Create a report (to a file) (not to screen)
2. Format the report so that it looks like this
CHANGED RULES:
BEFORE:
19,gmp,/ureports/exportgmp/extracts,/home/dslmain/gmp/scripts/copylsoftosftp.sh,gmpsftp@sftp1rod/gmp/export/extracts,YES,<where>acaact<yesterday> <where>acafee<yesterday> <wher
e>acagrp<yesterday> <where>acpos<yesterday> <where>actran<yesterday> <where>bil<yesterday><any> <where>bk<yesterday> <where>bk1<yesterday> <where>clcd<yesterday> <where>clientnam
e<yesterday> <where>corpbil<yesterday><any> <where>cqpyee<yesterday> <where>tr<yesterday> <where>tf<yesterday> <where>tt<yesterday> <where>tpcont<yesterday> <where>tpcont1<yester
day> <where>tpcont2<yesterday> <where>oldbil<yesterday><any> <where>ol<yesterday> <where>oipos<yesterday> <where>dc<yesterday><any> <where>dc2<yesterday> <where>di<yesterday> <wh
ere>dierr<yesterday> <where>espos<any><yesterday> <where>fdxref<yesterday> <where>fx<yesterday> <where>gnexch<yesterday> <where>kyfldc<yesterday> <where>kyfldd<yesterday> <where
>mfaccn<yesterday> <where>mfbr<yesterday> <where>mfcl<yesterday> <where>mfclac<yesterday> <where>mfclac1<yesterday> <where>mfclac2<yesterday> <where>mfclad1<yesterday> <where>mfc
lad2<yesterday> <where>mfclis<yesterday> <where>mfcsip<yesterday> <where>mfdoc<yesterday> <where>mfendt<yesterday> <where>mffact<yesterday> <where>mfhs<yesterday> <where>mfhsac<
yesterday> <where>mfhshd<yesterday> <where>mfinrt<yesterday> <where>mfirs<yesterday> <where>mfobj<yesterday> <where>mfrlac<yesterday> <where>mfrr<yesterday> <where>mfsc<yesterday
> <where>mfsc1<yesterday> <where>mfsc2<yesterday> <where>mfsc3<yesterday> <where>mfscdates<yesterday> <where>mfscen<yesterday> <where>mfscmf1<yesterday> <where>mfscmf2<yesterday>
<where>mfscnm<yesterday> <where>mfsymb<yesterday> <where>mm<yesterday> <where>ncadj<yesterday> <where>ncrr<yesterday> <where>ncscl<yesterday> <where>ncsplt<yesterday> <where>omf
i<any><yesterday> <where>omhist1<yesterday> <where>omhist2<yesterday> <where>omordl<yesterday> <where>omordr<yesterday> <where>omordr1<yesterday> <where>omordr2<yesterday> <where
>sm<yesterday> <where>spc<yesterday> <where>sr<yesterday> <where>sr1<yesterday> <where>sr2<yesterday> <where>gnexpd<yesterday> <where>tpcdtl<yesterday> <where>tpkptl<yesterday> <
where>jejldc<yesterday> <where>nalog<yesterday> <where>cqhead<yesterday> <where>cqform<yesterday> <where>mfasst<yesterday> <where>mfrras<yesterday> <where>tpgb<yesterday> <where>
mfcdtl<yesterday> <where>achstm<yesterday> <where>mfacct<yesterday> <where>gncode<yesterday>,YES
AFTER:
19,gmp,/ureports/exportgmp/extracts,/home/dslmain/gmp/scripts/copylsoftosftp.sh,gmpsftp@sftp1rod/gmp/export/extracts,YES,<where>newgjv<yesterday> <where>acaact<yesterday> <wher
e>acafee<yesterday> <where>acagrp<yesterday> <where>acpos<yesterday> <where>actran<yesterday> <where>bil<yesterday><any> <where>bk<yesterday> <where>bk1<yesterday> <where>clcd<ye
sterday> <where>clientname<yesterday> <where>corpbil<yesterday><any> <where>cqpyee<yesterday> <where>tr<yesterday> <where>tf<yesterday> <where>tt<yesterday> <where>tpcont<yesterd
ay> <where>tpcont1<yesterday> <where>tpcont2<yesterday> <where>oldbil<yesterday><any> <where>ol<yesterday> <where>oipos<yesterday> <where>dc<yesterday><any> <where>dc2<yesterday>
<where>di<yesterday> <where>dierr<yesterday> <where>espos<any><yesterday> <where>fdxref<yesterday> <where>fx<yesterday> <where>gnexch<yesterday> <where>kyfldc<yesterday> <where>
kyfldd<yesterday> <where>mfaccn<yesterday> <where>mfbr<yesterday> <where>mfcl<yesterday> <where>mfclac<yesterday> <where>mfclac1<yesterday> <where>mfclac2<yesterday> <where>mfcl
ad1<yesterday> <where>mfclad2<yesterday> <where>mfclis<yesterday> <where>mfcsip<yesterday> <where>mfdoc<yesterday> <where>mfendt<yesterday> <where>mffact<yesterday> <where>mfhs<
yesterday> <where>mfhsac<yesterday> <where>mfhshd<yesterday> <where>mfinrt<yesterday> <where>mfirs<yesterday> <where>mfobj<yesterday> <where>mfrlac<yesterday> <where>mfrr<yesterd
ay> <where>mfsc<yesterday> <where>mfsc1<yesterday> <where>mfsc2<yesterday> <where>mfsc3<yesterday> <where>mfscdates<yesterday> <where>mfscen<yesterday> <where>mfscmf1<yesterday>
<where>mfscmf2<yesterday> <where>mfscnm<yesterday> <where>mfsymb<yesterday> <where>mm<yesterday> <where>ncadj<yesterday> <where>ncrr<yesterday> <where>ncscl<yesterday> <where>ncs
plt<yesterday> <where>omfi<any><yesterday> <where>omhist1<yesterday> <where>omhist2<yesterday> <where>omordl<yesterday> <where>omordr<yesterday> <where>omordr1<yesterday> <where>
omordr2<yesterday> <where>sm<yesterday> <where>spc<yesterday> <where>sr<yesterday> <where>sr1<yesterday> <where>sr2<yesterday> <where>gnexpd<yesterday> <where>tpcdtl<yesterday> <
where>tpkptl<yesterday> <where>jejldc<yesterday> <where>nalog<yesterday> <where>cqhead<yesterday> <where>cqform<yesterday> <where>mfasst<yesterday> <where>mfrras<yesterday> <wher
e>tpgb<yesterday> <where>mfcdtl<yesterday> <where>achstm<yesterday> <where>mfacct<yesterday> <where>gncode<yesterday>,YES
SPECIFICS:
Added to t_search: <where>newgjv<yesterday>
-----------------------------------------------------------------------
SUMMARY REPORT
-----------------
CHANGED=1
RULE: 19(gmp)
-----------------------------------------------------------------------
Report specifics:
1. You can see that for "CHANGED RULES" I need to show the entire old and new RULE and then in the SPECIFICS show exactly where the change took place (i.e. field).
2. In the Summary Report I need to show the "t_client" field after each "rule"
3. This will also need to work if data in 2.txt was removed; so if I removed say string <where>gncode<yesterday> the report should read:
CHANGED RULES:
BEFORE:
19,gmp,/ureports/exportgmp/extracts,/home/dslmain/gmp/scripts/copylsoftosftp.sh,gmpsftp@sftp1rod/gmp/export/extracts,YES,<where>acaact<yesterday> <where>acafee<yesterday> <wher
e>acagrp<yesterday> <where>acpos<yesterday> <where>actran<yesterday> <where>bil<yesterday><any> <where>bk<yesterday> <where>bk1<yesterday> <where>clcd<yesterday> <where>clientnam
e<yesterday> <where>corpbil<yesterday><any> <where>cqpyee<yesterday> <where>tr<yesterday> <where>tf<yesterday> <where>tt<yesterday> <where>tpcont<yesterday> <where>tpcont1<yester
day> <where>tpcont2<yesterday> <where>oldbil<yesterday><any> <where>ol<yesterday> <where>oipos<yesterday> <where>dc<yesterday><any> <where>dc2<yesterday> <where>di<yesterday> <wh
ere>dierr<yesterday> <where>espos<any><yesterday> <where>fdxref<yesterday> <where>fx<yesterday> <where>gnexch<yesterday> <where>kyfldc<yesterday> <where>kyfldd<yesterday> <where
>mfaccn<yesterday> <where>mfbr<yesterday> <where>mfcl<yesterday> <where>mfclac<yesterday> <where>mfclac1<yesterday> <where>mfclac2<yesterday> <where>mfclad1<yesterday> <where>mfc
lad2<yesterday> <where>mfclis<yesterday> <where>mfcsip<yesterday> <where>mfdoc<yesterday> <where>mfendt<yesterday> <where>mffact<yesterday> <where>mfhs<yesterday> <where>mfhsac<
yesterday> <where>mfhshd<yesterday> <where>mfinrt<yesterday> <where>mfirs<yesterday> <where>mfobj<yesterday> <where>mfrlac<yesterday> <where>mfrr<yesterday> <where>mfsc<yesterday
> <where>mfsc1<yesterday> <where>mfsc2<yesterday> <where>mfsc3<yesterday> <where>mfscdates<yesterday> <where>mfscen<yesterday> <where>mfscmf1<yesterday> <where>mfscmf2<yesterday>
<where>mfscnm<yesterday> <where>mfsymb<yesterday> <where>mm<yesterday> <where>ncadj<yesterday> <where>ncrr<yesterday> <where>ncscl<yesterday> <where>ncsplt<yesterday> <where>omf
i<any><yesterday> <where>omhist1<yesterday> <where>omhist2<yesterday> <where>omordl<yesterday> <where>omordr<yesterday> <where>omordr1<yesterday> <where>omordr2<yesterday> <where
>sm<yesterday> <where>spc<yesterday> <where>sr<yesterday> <where>sr1<yesterday> <where>sr2<yesterday> <where>gnexpd<yesterday> <where>tpcdtl<yesterday> <where>tpkptl<yesterday> <
where>jejldc<yesterday> <where>nalog<yesterday> <where>cqhead<yesterday> <where>cqform<yesterday> <where>mfasst<yesterday> <where>mfrras<yesterday> <where>tpgb<yesterday> <where>
mfcdtl<yesterday> <where>achstm<yesterday> <where>mfacct<yesterday> <where>gncode<yesterday>,YES
AFTER:
19,gmp,/ureports/exportgmp/extracts,/home/dslmain/gmp/scripts/copylsoftosftp.sh,gmpsftp@sftp1rod/gmp/export/extracts,YES,<where>newgjv<yesterday> <where>acaact<yesterday> <wher
e>acafee<yesterday> <where>acagrp<yesterday> <where>acpos<yesterday> <where>actran<yesterday> <where>bil<yesterday><any> <where>bk<yesterday> <where>bk1<yesterday> <where>clcd<ye
sterday> <where>clientname<yesterday> <where>corpbil<yesterday><any> <where>cqpyee<yesterday> <where>tr<yesterday> <where>tf<yesterday> <where>tt<yesterday> <where>tpcont<yesterd
ay> <where>tpcont1<yesterday> <where>tpcont2<yesterday> <where>oldbil<yesterday><any> <where>ol<yesterday> <where>oipos<yesterday> <where>dc<yesterday><any> <where>dc2<yesterday>
<where>di<yesterday> <where>dierr<yesterday> <where>espos<any><yesterday> <where>fdxref<yesterday> <where>fx<yesterday> <where>gnexch<yesterday> <where>kyfldc<yesterday> <where>
kyfldd<yesterday> <where>mfaccn<yesterday> <where>mfbr<yesterday> <where>mfcl<yesterday> <where>mfclac<yesterday> <where>mfclac1<yesterday> <where>mfclac2<yesterday> <where>mfcl
ad1<yesterday> <where>mfclad2<yesterday> <where>mfclis<yesterday> <where>mfcsip<yesterday> <where>mfdoc<yesterday> <where>mfendt<yesterday> <where>mffact<yesterday> <where>mfhs<
yesterday> <where>mfhsac<yesterday> <where>mfhshd<yesterday> <where>mfinrt<yesterday> <where>mfirs<yesterday> <where>mfobj<yesterday> <where>mfrlac<yesterday> <where>mfrr<yesterd
ay> <where>mfsc<yesterday> <where>mfsc1<yesterday> <where>mfsc2<yesterday> <where>mfsc3<yesterday> <where>mfscdates<yesterday> <where>mfscen<yesterday> <where>mfscmf1<yesterday>
<where>mfscmf2<yesterday> <where>mfscnm<yesterday> <where>mfsymb<yesterday> <where>mm<yesterday> <where>ncadj<yesterday> <where>ncrr<yesterday> <where>ncscl<yesterday> <where>ncs
plt<yesterday> <where>omfi<any><yesterday> <where>omhist1<yesterday> <where>omhist2<yesterday> <where>omordl<yesterday> <where>omordr<yesterday> <where>omordr1<yesterday> <where>
omordr2<yesterday> <where>sm<yesterday> <where>spc<yesterday> <where>sr<yesterday> <where>sr1<yesterday> <where>sr2<yesterday> <where>gnexpd<yesterday> <where>tpcdtl<yesterday> <
where>tpkptl<yesterday> <where>jejldc<yesterday> <where>nalog<yesterday> <where>cqhead<yesterday> <where>cqform<yesterday> <where>mfasst<yesterday> <where>mfrras<yesterday> <wher
e>tpgb<yesterday> <where>mfcdtl<yesterday> <where>achstm<yesterday> <where>mfacct<yesterday> <where>gncode<yesterday>,YES
SPECIFICS:
Removed from t_search: <where>gncode<yesterday>
Thanks