Hi @Peter Timmers , I think it would be necessary to use regular expressions anyway, but it could become more elegant by using combination of some transformers including HTMLExtractor.
Can you share your current solution?
Hi @Peter Timmers , I think it would be necessary to use regular expressions anyway, but it could become more elegant by using combination of some transformers including HTMLExtractor.
Can you share your current solution?
Regular expression worked a treat.
I haven't got back to the problem yet, but when I do, my next task is to take the two json datasets, extract the geojson to features and join the metadata json to those features. It's been a while since I've done something like this.
Regular expression worked a treat.
I haven't got back to the problem yet, but when I do, my next task is to take the two json datasets, extract the geojson to features and join the metadata json to those features. It's been a while since I've done something like this.
Sorry, still unclear what the problem is. If you can show us entire content of the <script> and the JSON text(s) you need to extract from the script, we might be able to find out a solution.
Hello, You could read the html file with the text reader and use (read whole file at once = yes). With attributeManager find the position “<script>” in an attribute and in another attribute find the position “</script>”. In a third attribute use the @Substring command ex: @Substring(@Value(text_line_data),@Value(Start),@Value(End)-@Value(Start)+8)
* +8 is the length of the tag if you want to see it.
Regular expression worked a treat.
I haven't got back to the problem yet, but when I do, my next task is to take the two json datasets, extract the geojson to features and join the metadata json to those features. It's been a while since I've done something like this.
I was mistaken, my regex is not working, but the amount of json is also too big to drop on here (200,000+ lines).
Regex might be too slow for the 200,000 lines also. Debugging takes about 3 min + to run the workbench.
In the end I want to use a featurereader on geojson text and add the metadata attributes to each feature.
<head><script>
var metaData = { t150+ lines of json]
}
var geojsonData = { 200,000 + lines of geojson]
}
</script>
</head>
Hello, You could read the html file with the text reader and use (read whole file at once = yes). With attributeManager find the position “<script>” in an attribute and in another attribute find the position “</script>”. In a third attribute use the @Substring command ex: @Substring(@Value(text_line_data),@Value(Start),@Value(End)-@Value(Start)+8)
* +8 is the length of the tag if you want to see it.
Substring find without using regex is appealing right now.