TextAdapter - WhiteSpace Attribute Separator

2760
3
04-15-2014 12:51 AM
DavidMartin
Occasional Contributor II
Is there any way to specify that the Attribute Separator in the TextAdapter should be "any amount of spaces"? I cannot use the predefined character class for whitespace, as it includes new lines, which represent message separators. Is there a way to inject RegEx sequences here??
0 Kudos
3 Replies
RJSunderman
Esri Regular Contributor
Hello David -

Sorry, but the text adapter does not support events which have a variable amount of whitespace (or other characters) between attribute values. You can specify a single character or a multi-character sequence using HTML encoding (&#32 for an ASCII space for example), but the attribute separator cannot be set to a RegEx pattern.

If you knew that attributes were delimited by exactly three ASCII spaces you could specify &#32&#32&#32 as the attribute separator. Syntax should actually be unicode format: \u003B (semi-colon) \u0020 (ASCII space) ... see illustration below. Also, multi-character delimiters do not seem to be working in 10.2.2 ... a bug has been entered to address this.

[ATTACH=CONFIG]33172[/ATTACH]

You might be able to design a GeoEvent Service, using the support for Java String functions available in the 10.2.2 release, to reduce the variable delimiters between event attributes to a single, standard delimiter ... but I think a better approach would be to explore a JavaScript solution to pre-process your incoming events, replace the variable delimitation with a single delimiter, and then write the event data to a TCP socket or WebSocket for a GeoEvent Service to ingest.

- RJ
0 Kudos
DavidMartin
Occasional Contributor II
Thanks RJ,
I'll take a look at the Javascript pre-processing option.
Cheers

David
0 Kudos
DavidMartin
Occasional Contributor II

Note there is now an extended version of the text adaptor that will cope with white space separators (and more) on Github:

solutions-geoevent-java/solutions-geoevent/adapters/regexText-adapter at master · Esri/solutions-geo...

0 Kudos