I have everything working except for index_start.scrub in a new ini I am writing.
I am not sure how to get both blocks (date and time) to capture and parse it into one string, which will be used for index_start
Here is the block that index_start is matching ( there is more string data before and after the sample, but this is just the important part).
"TX_DATE":"2018-04-27","START_TIME":"23:30","PROGRAMME_TITLE:"
Currently I only have the START_TIME capturing correctly and not the TX_DATE or together. This is what I have so far:
index_start.scrub {multi(debug)|"START_TIME":"||","|}
If someone could please lend me a hand in getting this to work, that would be appreciated :)
Thanks for the help.
To capture both the TX_DATE and START_TIME from the string and combine them into one string for index_start, you can modify the scrub expression as follows:
index_start.scrub {multi(debug)|"TX_DATE":"(\d{4}-\d{2}-\d{2})","START_TIME":"(\d{2}:\d{2})"|"$1 $2"}
Hope this will help.
The post is 5 years old I think it's a bit late lol
But it wouldn't work.. You either use separators or regex.. And this regex expression doesn't look right
expanding on what japangelo said,your mixing separator string and regex method's which wont work.
we cannot use $1 $2 with webgrab regex so you have to do it like this..
index_start.scrub {regex||"TX_DATE":"(\d{4}-\d{2}-\d{2}","START_TIME":"\d{2}:\d{2})"||}
index_start.modify {replace|","START_TIME":"| }
webgrab regex uses || for delimeters for .scrub and " for .modify
index_start.modify {replace(type=regex)|"\",\"START_TIME\":\""| }
finally a another way to do it.
index_start.scrub {single|"START_TIME":"||"|"}
index_temp_1.scrub {single|"TX_DATE":"||"|"}
index_start.modify {addstart|'index_temp_1' }
above uses separator string method,you could also uses regex.