Skip to main content

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

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="expath/YOUR_ELEMENT_FOR_REGEX" />
<arc:set attr="decimalPattern" value="\=0-9\]+\.?\.0-9\]*" />
<arc:set attr="price" value="emyString | regexmatch(cdecimalPattern])]" />

Then in your map you would set the value to t_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="expath/YOUR_ELEMENT_FOR_REGEX" />
<arc:set attr="decimalPattern" value="\=0-9\]+\.?\.0-9\]*" />
<arc:set attr="price" value="emyString | regexmatch(cdecimalPattern])]" />

Then in your map you would set the value to t_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="uxpath(PWK/PWK06)]" />
<arc:set attr="qpaAmount" value="uqpaString | split('=',2)]" />

<arc:set attr="result.text">&qpaAmount]</arc:set>

 


Reply