AnsweredAssumed Answered

Parsing a list issue

Question asked by glorifindal on Aug 25, 2014
Latest reply on Aug 26, 2014 by glorifindal

Hi there,

 

I'm hoping someone here can help with parsing a list that I am importing from Excel ...

 

I need to loop through it and do something with each of the paired values ... here is the structure:

 

<Business Area>Retail

<Business Status>Active - 24/7

<Business Scope>All ENC

<Business Approach>Cold

<Business Description>This could well be some text, with some return seperated data also, making using the GetValue function useless...

Customer Details

Customer Address

Customer Search

Customer Security

Contact History

<Business Name>Offer of the Day

<Business Status>In Development

<Business Type>Desktop Application

<Business Version>4.6

 

So from the each loop I would need two variables -

$_label = Business Area

$_Value = Retail

And so on.

 

I can't use the GetValue function - due to the CR seperated values which are part of <Business Description> in this example - and could be part of any of the values really.

 

This would give me:

<Business Description>This could well be some text, with some return seperated data also, making using the GetValue function useless...

Instead of:

<Business Description>This could well be some text, with some return seperated data also, making using the GetValue function useless...

Customer Details

Customer Address

Customer Search

Customer Security

Contact History

 

I suppose what I am trying to work out is the value between each "<" and ">" for the label - easy enough.

But working out the value from the ">" until the next "<" is eluding me.

 

Any help greatly appreciated.

 

Kindest regards

 

Glorifindal

Outcomes