Hey guys,
The input file is as below
1|711,729a,726|h711_729A_726_ppsp|H323
1|711,729a,726|s711_729A_726_ppsp|SIP
2|729ab,726,711|h729AB_726_711_ppsp|H323
2|729ab,726,711| s729AB_726_711_ppsp|SIP
The output file should be as below.
Codec_Descriptor_ID=1|Codec_Descriptor_Value=711
Codec_Descriptor_ID=2|Codec_Descriptor_Value=726
Codec_Descriptor_ID=3|Codec_Descriptor_Value=729a
Codec_Descriptor_ID=4|Codec_Descriptor_Value=729ab
Any suggestions???
Thx
How do I split a input row into multiple output rows
Moderators: chulett, rschirm, roy
Re: How do I split a input row into multiple output rows
What's your input stage? Flat-file? What about your output stage?
gateleys
gateleys
hi champa,
ok if i understood your question correctly then do this,
specify four columns in your source seq. file
col A , col B, col C and col D
specify the quote character as 000
have a link going from this seq. file stage into a transformer.
pull col B into a stage variabe and give the derivation as
in the above code, char(010) is the value for a line terminator in unix.
have this link going into a seq. file stage.
in this seq file stage, specify both the delimiter and quote character as 000.
you will see that your output will have the following values
now you have all those values, just repeating themselves. Now you only want discrete of those values.
you can pass that through a hash file, into a sec. transformer, where you can attach the column Codec_Descriptor_ID, use it as an identity column and finally into the target seq. file
so if you did all that correctly, your target file should have the require output that you desire.
i hope it helps
cheers
ok if i understood your question correctly then do this,
specify four columns in your source seq. file
col A , col B, col C and col D
specify the quote character as 000
have a link going from this seq. file stage into a transformer.
pull col B into a stage variabe and give the derivation as
Code: Select all
Field(In.col B,",",1):char(010):Field(In.col B,",",2):char(010):Field(In.col B,",",3)
have this link going into a seq. file stage.
in this seq file stage, specify both the delimiter and quote character as 000.
you will see that your output will have the following values
Code: Select all
711
729a
726
711
729a
726
729ab
726
711
729ab
726
711
you can pass that through a hash file, into a sec. transformer, where you can attach the column Codec_Descriptor_ID, use it as an identity column and finally into the target seq. file
so if you did all that correctly, your target file should have the require output that you desire.
i hope it helps
cheers
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Champa
Explain the logic of how do you get this result. The logic is not mentioned clearly in your question
Explain the logic of how do you get this result. The logic is not mentioned clearly in your question
The output file should be as below.
Codec_Descriptor_ID=1|Codec_Descriptor_Value=711
Codec_Descriptor_ID=2|Codec_Descriptor_Value=726
Codec_Descriptor_ID=3|Codec_Descriptor_Value=729a
Codec_Descriptor_ID=4|Codec_Descriptor_Value=729ab
Regards
Siva
Listening to the Learned
"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
Siva
Listening to the Learned
"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
I agree. It is a vague and ambigous presentation of your problem. It would help if you could verbalize a little more and also about your file-formats.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE