I am trying to parse the result from Bloomberg Data Licence when they return a bulk data format.
This string is typically a bunch of key value pairs separated by a semi colon and indicated by a number for the data type they are.
The first three numbers are the fact that it is a 2d array with 4 results. The number before the value is the datatype, e.g. 5 is date and 3 is number, however this is not important right now.
Here is an example data response:
;2;4;2;5;20181201;3;102;5;20191201;3;101.000000;5;20201201;3;100.000000;5;20211201;3;100.000000;
Expected return would be to grab the dates and the values from this string, and the result would be:
20181201 - 102
20191201 - 101.000000
20201201 - 100.000000
20211201 - 100.000000
I have tried the following regex using replace:
5;(?P<date>\d{8})|\;3;(?P<value>\w+.\w+) and using replace value \1, \2 which returns the following:
;2;4;2;20181201,,102;5;20191201,101.000000;20201201,,100.000000;20211201,,100.000000;
I am still getting the return value of ;2;4;2 - how do I ignore these first three grouped values in my regex?
P.S. This is just example data, doesn't actually refer to anything