Extract data using a reference

Gents,

If there the possibility can to extract data using a reference from other file.

input.txt ( big file which contends all data
output.txt ( data extracted )
selection.txt ( information to extract the data

Example

In file input.txt there is big data each record have 56 lines like this.. then for example i will like to extract the record 39441.00 49781.00 so this record will be in file selection.txt. to extract all information (56 lines).

% VE464 V4.1.06
% Normal Acq
% SL            : 39441.00
% SN            : 49781.00
% SI            : 1
% StackNb       : 1
% FleetNb       : 10
% DsdNb         : 5
% SweepCounter  : 05376
% Sweep  Type   : b2=[CUSTOM -]
% Sweep Status  : 1
% Drive         : 75
% Gps Status    : $GPGGA,032536.00,2200.91436042,N,05046.52631472,E,5,16,0.6,155.203,M,-32.418,M,1.0,0000*6
% GNGSA         : $GNGSA,A,3,72,71,73,83,74,85,65,84,,,,,1.3,0.6,1.1*25
% GNGST         : $GNGST,032536.00,0.002,0.051,0.047,7.6,0.051,0.048,0.015*40
% GPZDA         : $GPZDA,032536.01,28,07,2017,00,00*6F
% PTNL         : $PTNL,GGK,032536.00,072817,2200.91436042,N,05046.52631472,E,12,16,1.3,EHT122.786,M*42
% TB            : 17/07/28 03:25:24:580000 [12324580000 microsec]
% QC type        : window = 1000 ms , normalized
% Time Inhibit  : 11
% EXTENDED TIME STATUS :
%     phase               warnings                overloads
%         force   Gv  Gs  masse pist. plaque
%Time         dist        1 2 3 1 2 3 1 2 3 4 5 6 F P M V E
0.5     0   0   0 128 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1.0     0   0   0 128 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1.5     0   0   0 128 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2.0     0   0   0 128 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2.5     0   0   0 128 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3.0     0   0   0 128 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3.5     0   0   0 128 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4.0     0   0   0 128 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4.5     0   0   0 128 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
5.0     0   0   0 128 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
5.5     1  71   7 128 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
6.0     1  76   7  44  15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
6.5    -1  76   6  33  21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
7.0     0  73   7  32  17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
7.5     0  72   6  38  19 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8.0     0  73   6  42  22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8.5     0  74   6  43  31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
9.0    -1  74   6  39  24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
9.5     1  73   6  44  26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
10.0    0  74   7  41  23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
10.5    1  72   7  45  21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
11.0    1  75   9  49  24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
11.5    2  76   8  51  26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
12.0    0   0   0  59  24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
% time end of prev sweep to up    :       230 ms
% pad up                          : 17/07/28 03:24:57:239
% pad down                        : 17/07/28 03:25:16:861
% time up to down                 :     19622 ms
% time down to pressure switch ON :      1220 ms
% time down to ready              :      1230 ms
% time down to sweep              :      7735 ms
% sweep length                    :     12000 ms

The purpose is to keep the same format like the input file.

I hope some one can help me with this if is possible

Any attempts / ideas / thoughts from your side (as you promised earlier)?

Hi RudiC.

:frowning: No.

I can extract part of the text. But no all .
Is this possible ,?

With the results you have seen from the other 90 threads you have started, you know this is possible. We are here to help you learn how to do projects like this on your own; not to act as your unpaid programming staff.

As with all shell script questions submitted to this forum, please tell us what operating system and shell you're using.

Clearly explain the format of the selection.txt file. (Is there ever more than one record to be selected? If so, what separates SL values in selection.txt ?)

Are there any separators between the 56 line records in input.txt ? (If so, what are the separators?)

And, most importantly, show us what you have done and where you are stuck.