Skip to Content
0
Former Member
Apr 10, 2009 at 04:41 AM

How to split a single file and then route it to different systems

144 Views

Hi All,

I have a requirement like...my incoming file(single file) needs to be split into 3 files based on a field "company code".and then route it into different systems.

my incoming file is like this .....

Header,name,.....,.....,........,.....,.....

Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......

EOF.

I need to split this file and my ouput file should be like this

For 1st system

Header,name,.....,.....,........,.....,.....

Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......

EOF.

For 2nd system

Header,name,.....,.....,........,.....,.....

Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......

EOF.

For 3rd system

Header,name,.....,.....,........,.....,.....

Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......

Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......

EOF.

and then send it three systems based on company code.

Can anyone tell me how this can be achieved?

Thanks,

Hemanth.