1
XML to CSV split at first space?
Question asked by Jeff Nixon - 8/16/2019 at 4:59 PM
Answered
Hi, I'm running the trial at the moment, and it's mostly working well. I just can't seem to work this out. In my XML files I have a field where the output is of this style:

10kg Plastic Drum (Non UN)

I need to removed the 10kg (this could be anything from 1 to 10000 kgs, so iI can't use position). I also need to reuse the weight portion in another CSV line.

I have tried with the splitstring function, but have no idea how to access and manipulate the output before passing it into the CSV.

Any ideas?

2 Replies

Reply to Thread
1
Liquid Support Replied
Employee Post Marked As Answer
Hi,

If you always have a 'kg' value, you should be able to use the 'Index Of' component with a value of 'kg' and then use the 'Left' component to grab the value. E.g. Here the 'Result' value will be '10'...

0
Jeff Nixon Replied
That's great. Also helped me get the packaging part. Many thanks.

Reply to Thread