Parser for comma separated fix tags

Imported from previous forum

Hello

Do we have any parser for logs like the below:
8=FIX.4.2,9=221,35=G,34=5

The output could be
8 (BeginString) = FIX4.2
9 (BodyLength) = 221
35 (MsgType) = G
34 (MsgSeqNum) = 5

Thanks in advance to all.

Wrote the following perl script which helps for the time being:

$fixMsg = '8=FIX.4.2,9=266,35=8’
foreach $pair (split(/,/, $fixMsg))
{
($_n, $_v) = split(/=/, $pair);
$qs{$_n} = $_v;
}
foreach $k (keys %qs)
{
print “Tag: $k Value: $qs{$k}\n”;
}