I need to be able to ingest the following string and remove everything but the financial values in an xml map connector
CIGNA;QPA=242.06
any direction is appreciated. This is for an x12 837 file
Best answer by wnielson
View originalI need to be able to ingest the following string and remove everything but the financial values in an xml map connector
CIGNA;QPA=242.06
any direction is appreciated. This is for an x12 837 file
Best answer by wnielson
View originalThere’s a pretty good example in the Arc documentation under Scripting > Formatters > String Formatters using regex pattern matching.
I would add a script node similar to the example shown
<arc:set attr="myString" value="[xpath/YOUR_ELEMENT_FOR_REGEX" />
<arc:set attr="decimalPattern" value="\[0-9\]+\.?\[0-9\]*" />
<arc:set attr="price" value="[myString | regexmatch([decimalPattern])]" />
Then in your map you would set the value to [_map.price]
I would play around with this as I just did a quick and dirty example.
There’s a pretty good example in the Arc documentation under Scripting > Formatters > String Formatters using regex pattern matching.
I would add a script node similar to the example shown
<arc:set attr="myString" value="[xpath/YOUR_ELEMENT_FOR_REGEX" />
<arc:set attr="decimalPattern" value="\[0-9\]+\.?\[0-9\]*" />
<arc:set attr="price" value="[myString | regexmatch([decimalPattern])]" />
Then in your map you would set the value to [_map.price]
I would play around with this as I just did a quick and dirty example.
Thanks! I actually was able to find a little bit of a simpler solution by just setting a custom script to
<arc:info title="Custom Script" desc="The custom script.">
<input name="FilePath" desc="The sending file path." />
<input name="XPath" desc="The current xpath in the loop." />
<input name="*" desc="The information of the current loop." />
</arc:info>
<arc:set attr="qpaString" value="[xpath(PWK/PWK06)]" />
<arc:set attr="qpaAmount" value="[qpaString | split('=',2)]" />
<arc:set attr="result.text">[qpaAmount]</arc:set>
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.