Extracting Delimiter 'TAG' Data From log files

Hi
I am trying to extract data from within a log file and output format to a new file for further manipulation can someone provide script to do this?

For example I have a file as below and just want to extract all delimited variances of tag 32=* up to the delimiter "|" and output to a new file so that I can calculate the total of these values.

$cat fix1.log

FIX4.4 |0=12|55=LIT.L|48=123456|32=5|38=100|10=200|
FIX4.4 |0=12|55=LIT.L|48=123456|32=15|38=100|10=200|
FIX4.4 |0=12|55=LIT.L|48=123456|32=115|38=100|10=200|
FIX4.4 |0=12|55=LIT.L|48=123456|32=500|38=100|10=200|
FIX4.4 |0=12|55=LIT.L|48=123456|32=2|38=100|10=200|110=233
FIX4.4 |0=12|55=LIT.L|48=123456|32=5|38=100|10=200|110=221
FIX4.4 |0=12|55=LIT.L|48=123456|32=5|38=100|10=200|775=1
FIX4.4 |0=12|55=LIT.L|48=123456||35=1|34=52|32=2|38=100|10=200|
FIX4.4 |0=12|55=LIT.L|48=123456|35=0|32=5|38=100|10=200|
FIX4.4 |0=12|55=LIT.L|48=123456|35=5|32=4|38=100|10=200|

As you can see the delimited tag 32 is not always in the same position within the file and ideally I would like the output to consist of just the individual numeric values after the 32=

5
15
115
500

etc etc

Assistance appreciated

Buddy

One way:

 sed 's/.*32=\([0-9]*\).*/\1/' file

Guru.

1 Like

Excellent !!

Thanks Guru