Text not present in file

File 1:

AAAAAA-100000 | ID: C110X01
AAAAAA-100000 | ID : P110X01
DDDDDD-8911694 | ID: P110X01

File2:-

------------------------------------------------------------------------
r1111111 | AAAAAA-100000 | 2011-06-16 11:47:33 +0530 (Fri, 16 Jun 2011) | 2 lines
Changed paths:
   A /home/india/V_26.00.00.00 (from /home/india/V_25.00.02.01:125142)

New Branch created
ID: C110X01
-----------------------------------------------------------------------
r2211111 | AAAAAA-100000 | 2011-06-16 11:47:33 +0530 (Fri, 16 Jun 2011) | 2 lines
Changed paths:
   M /home/india/V_26.00.00.00 (from /home/india/V_25.00.02.01:125142)

New branch created
ID: P110X01
-----------------------------------------------------------------------

r4111111 | BBBBBB-200000 | 2012-06-16 11:47:33 +0530 (Fri, 16 Jun 2011) | 2 lines
Changed paths:
   M /home/india/V_26.00.00.00 (from /home/india/V_25.00.02.01:125142)

New Branch created
 ID: D130X01
-----------------------------------------------------------------------
r3111111 |CCCCCC-300000 | 2013-06-16 11:47:33 +0530 (Fri, 16 Jun 2011) | 2 lines
Changed paths:
   A /home/india/V_26.00.00.00 (from /home/india/V_25.00.02.01:125142)

New Branch created
ID: E150X61
-----------------------------------------------------------------------

And what is your question/issue?

Hi Apologies for posting incomplete thread.

I have below question.

I have two file having below contents; I want to list out result which are present in file but not present in File 2 ,

Final result should display result from file1 look like this

AAAAAA-100000 | ID : Z110X01
DDDDDD-8911694 | ID: P110X01

File 1:

AAAAAA-100000 | ID: C110X01
AAAAAA-100000 | ID : P110X01
DDDDDD-8911694 | ID: P110X01

File2:-

-----------------------------------------------------------------------
r1111111 | AAAAAA-100000 | 2011-06-16 11:47:33 +0530 (Fri, 16 Jun 2011) | 2 lines
Changed paths:
   A /home/india/V_26.00.00.00 (from /home/india/V_25.00.02.01:125142)

New Branch created
ID: C110X01
-----------------------------------------------------------------------
r2211111 | AAAAAA-100000 | 2011-06-16 11:47:33 +0530 (Fri, 16 Jun 2011) | 2 lines
Changed paths:
   M /home/india/V_26.00.00.00 (from /home/india/V_25.00.02.01:125142)

New branch created
ID: P110X01
----------------------------------------------------------------------
r4111111 | BBBBBB-200000 | 2012-06-16 11:47:33 +0530 (Fri, 16 Jun 2011) | 2 lines
Changed paths:
   M /home/india/V_26.00.00.00 (from /home/india/V_25.00.02.01:125142)

New Branch created
 ID: D130X01
-----------------------------------------------------------------------
r3111111 |CCCCCC-300000 | 2013-06-16 11:47:33 +0530 (Fri, 16 Jun 2011) | 2 lines
Changed paths:
   A /home/india/V_26.00.00.00 (from /home/india/V_25.00.02.01:125142)

New Branch created
ID: E150X61
------------------------------------------------------------------------

Still a bit sparse a specification. Try

awk 'NR==FNR {if (NF) T[$3 " | " $(NF-1) " " $NF]; next} !($0 in T)' RS="--+" file2 RS="\n" file1
AAAAAA-100000 | ID : P110X01
DDDDDD-8911694 | ID: P110X01

Tested on linux with exactly the samples given above - please be aware that your file1's data structure varies which may make the proposal fail.

1 Like

Thanks for your response .I have tried this code but no luck. it display all the record of File 1.

awk 'NR==FNR {if (NF) T[$3 " | " $(NF-1) " " $NF]; next} !($0 in T)' RS="---+" Modifed_results_26 RS="\n" M3

What's your result if you run it on the files given in post#1?

I am getting below out after using code provided in tag1

AAAAA-100000 | ID: C110X01
AAAAAA-100000 | ID : P110X01
DDDDDD-8911694 | ID: P110X01

Looks like an A is missing in line 1. If that's just a typo, look for invisible (control) characters in your file. If there are none, I'm out of ideas. The proposal was tested and worked with the data given.

any help will be highly appreciated

What did you do to spot the error? Did you download the files in post#1 and run the code against them? did you check for control chars?