Source File separated with two delimiters
Posted: Sat Jul 03, 2010 12:24 am
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
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