Skip to Content
0
Former Member
Jul 16, 2007 at 03:03 PM

Message Mapping, First and last values in a CSV file

23 Views

I'm having problems with a Message Mapping that requires me to take the values from the first line in a CSV and the last line to calculate other values...

The source message type in my mapping is as follow

<MT_Message>
    <Header>                  1..1
         <ID>
         <StartDate>
         <EndDate>
   <Records>                 1...unbounded
           <Interval> 
           <Number>

I need to take the first row/occurence of Records and use this to calculate the Startime. I also need to take the last occurence of Records to calculate the stop time

This is my CSV file content

H	FORECASTS 	20080101	20081231	17568
D	20080101	1	1	66.29283
D	20080101	1	2	61.1344
D	20080101	2	1	61.1344

In this case I need to take the values 1 1 for the StartTime and 2 1 for the StopTime.

How can this be done?