Hi all:
I have two files:
file1:
74 DS 9871 199009871 1 1990 4 1 165200 Sc
pr de te sa ox
1.0 1.0 13.0000 35.7560 5.950
3.0 3.0 13.0100 35.7550 5.970
**
74 DS 99004 74DS99004 6738 1990 4 1 165200 Eb
pr de te sa ox
1.0 1.0 13.0000 35.7560 5.950
3.0 3.0 13.0100 35.7550 5.970
**
29 CS 563 198700563 280 1987 7 27 043900 Ic
pr de te sa ox
9.0 8.9 12.2700 35.6500 6.060
11.0 10.9 12.2100 35.6490 6.100
**
74 DS 9871 199009871 8 1990 4 3 161500 Sc
pr de te sa ox
1.0 1.0 13.4500 35.7420 5.940
3.0 3.0 13.4500 35.7420 5.950
**
74 DS 99004 74DS99004 6911 1990 4 6 042500 Eb
pr de te sa
2.0 2.0 15.3300 35.5920
3.0 3.0 15.3300 35.5920
**
and file2:
29 CS 563 198700563 280 1987 7 27 043900 Ic
74 DS 99004 74DS99004 6738 1990 4 1 165200 Eb
74 DS 99004 74DS99004 6911 1990 4 6 042500 Eb
What I need is to retain from file1 the full records pointed in file 2 (not need to be ordered) in such as:
74 DS 99004 74DS99004 6738 1990 4 1 165200 Eb
pr de te sa ox
1.0 1.0 13.0000 35.7560 5.950
3.0 3.0 13.0100 35.7550 5.970
**
29 CS 563 198700563 280 1987 7 27 043900 Ic
pr de te sa ox
9.0 8.9 12.2700 35.6500 6.060
11.0 10.9 12.2100 35.6490 6.100
**
74 DS 99004 74DS99004 6911 1990 4 6 042500 Eb
pr de te sa
2.0 2.0 15.3300 35.5920
3.0 3.0 15.3300 35.5920
**
I have tried several approaches with awk oneliners, but didn't succeed because don't know how to deal with multiple files each with dissimilar ORS and FS. That is for file1 RS and ORS are the awk defaults whereas for file2:
{RS="\\*\\*\n+";ORS="**\n"}.
Do you have a clue on how to proceed?
Thanks,
r.-