Page 1 of 1

Source File separated with two delimiters

Posted: Sat Jul 03, 2010 12:24 am
by Vignesh Shanmugam
Hi all,

I have requirement to extract records from a source file separated with two delimiters. Like shown below.

Source File:-
___________

"CLAIM_NO"~"DOL"~"INJURY1"#"INJURY2"#"INJURY3"~"POLICY_NO"
"10000001"~"2010-01-01"~"HEAD"#"NECK"#"LEG"~"12345"
"20000002"~"2008-01-01"~"FINGER"#"ABDOMEN"#"CHEST"~"11111"
"30000003"~"2009-01-01"~"ANKLE"#"NECK"#"LEG"~"22222"

My out put File should be off the following format

OutPut File:-
__________


"CLAIM_NO"~"DOL"~"INJURY"~"POLICY_NO"
"10000001"~"2010-01-01"~"HEAD"~"12345"
"10000001"~"2010-01-01"~"NECK"~"12345"
"10000001"~"2010-01-01"~"LEG"~"12345"
"20000002"~"2008-01-01"~"FINGER""~"11111"
"20000002"~"2008-01-01"~"ABDOMEN"~"11111"
"20000002"~"2008-01-01"~"CHEST"~"11111"
"30000003"~"2009-01-01"~"ANKLE"~"22222"
"30000003"~"2009-01-01"~"NECK"~"22222"
"30000003"~"2009-01-01"~"LEG"~"22222"

There might be "n" number of Injuries separated by "#".Each and every Injury separated with "#" should go to th next line.

Any Help would be Highly Appreciated

Thanks In Advance

Posted: Sat Jul 03, 2010 3:50 am
by ray.wurlod
This is best achieved using a server job and the dynamic array handling abilities of the Hashed File or UniVerse stage types.

If you must use a parallel job, then it looks like a job for a Column Import stage to parse the nested information, and a Pivot stage to generate the multiple rows.