AnsweredAssumed Answered

Your ideas for a complex requirement

Question asked by britto.parthalomew on Mar 17, 2017
Latest reply on Mar 21, 2017 by britto.parthalomew

Hi folks,

I have a complex requirement. I need your ideas on the approach. My mind stopped thinking after lots of tries

I have a data positioned flat file. Below is a sample data with pipe delimiters for understanding

 

01|1234| |000|098|header

04|1234| |000|098|ABC Comments

05|1234| |000|098|ABC Comments Continued

05|1234| |000|098|RTY Comments 

04|1234| |000|098|XYZ Comments

05|1234| |000|098|XYZ Comments Continued

05|1234| |000|098|XYZ 12345 Comments Continued

05|1234| |000|098|LMN Comments

05|1234| |000|098|LMN Comments Continued

 

The requirement is

1.  Ignore header 01

2. Number 04 is main record that needs to be inserted into NS

3. Number 05 is continuation of 04 comments. What we need from this record is only the comments which needs to be concatenated to the comments in 04. We have to concatenate all the 05s comments with number 04 comments

5. the final record should contain all the fields from 04 and the comments from all 05s. 05 appear min 0 max unbounded

6. And also if any numbers appear in 05 (example: 12345 in the 05 comments field), this should be extracted and passed to another field in NS profile. This number can appear in any one of 05s only once

 

My final record should look like below for the above example

04|1234| |000|098|ABC Comments ABC Comments Continued RTY Comments

04|1234| |000|098|XYZ Comments XYZ Comments Continued XYZ 12345 Comments Continued LMN Comments LMN Comments Continued |12345

 

Any thoughts or ideas would be a great help!

 

Thank you

Britto

 

 

 

 

 

Outcomes