splitsingle row into multiple rows
Moderators: chulett, rschirm, roy
splitsingle row into multiple rows
I have requirment like this my inputs structure is
loc-key,code_key,year,totsales,,jan,feb.....dec but out put ssould be in this format
loc_key,codekey,year,jan,tosales
lockey,codkey,year,feb,totsales
Using Transformer how to implment please can any one help me
Thanks
loc-key,code_key,year,totsales,,jan,feb.....dec but out put ssould be in this format
loc_key,codekey,year,jan,tosales
lockey,codkey,year,feb,totsales
Using Transformer how to implment please can any one help me
Thanks
Far simpler to install the stage and use that, then it would be all automagic. I don't recall it being one of the 'optional' plug-ins but seems like it must be if you really don't have it.
Check the FAQ forum, there is a post there on creating multiple rows from a single row with a couple of different techniques, from what I recall. If you really want to play the game that way, give it a read.
![Confused :?](./images/smilies/icon_confused.gif)
Check the FAQ forum, there is a post there on creating multiple rows from a single row with a couple of different techniques, from what I recall. If you really want to play the game that way, give it a read.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Why should I write it all up again when it's already in the FAQ Forum as I noted? Here is a direct link:
viewtopic.php?t=88639
Start there and let us know if you have any questions after you've tried to implement it.
And in your spare time, install the Pivot stage.
viewtopic.php?t=88639
Start there and let us know if you have any questions after you've tried to implement it.
And in your spare time, install the Pivot stage.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Did you try to do it yourself buddy. Give Roy's methodology a shot. Also if you dont know awk it will be hard for you to even understand the code i give you. Try to do it yourself, if nothing works out at the end then post again and i will give you the awk code.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
splitsingle row into multiple rows
Really you so sweet man i like you so much the way which you answering for my small doubts
please send me that awk code first i have to resolve these issue i will start learning qwk tomorrow onwards please send me that code
Thanks
:-):)
please send me that awk code first i have to resolve these issue i will start learning qwk tomorrow onwards please send me that code
Thanks
![Smile :-)](./images/smilies/icon_smile.gif)
![Confused :?](./images/smilies/icon_confused.gif)
![Confused :?](./images/smilies/icon_confused.gif)
![Confused :?](./images/smilies/icon_confused.gif)
Really...
![Shocked :shock:](./images/smilies/icon_eek.gif)
Anyways, heres the code.
Code: Select all
awk 'BEGIN{FS=",";OFS=","}{for(i=5;i<=NF;i++) print $1,$2,$3,$i,$4}' yourfile.txt > newfile.txt
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Hi
please look into these below code iam not able genrate new key
even a_key-------->column having null ,it should genrate key. do u think technically any problem in below code iam not able genrate new keys
If isNULL(a_key) Then (DSLink10.max_loc_Key + KeyMgtGetNextValue(DSJobStartTimestamp)) Else DSLink5.SK_LOCATION_KEY
Thanks
![Confused :?](./images/smilies/icon_confused.gif)
even a_key-------->column having null ,it should genrate key. do u think technically any problem in below code iam not able genrate new keys
If isNULL(a_key) Then (DSLink10.max_loc_Key + KeyMgtGetNextValue(DSJobStartTimestamp)) Else DSLink5.SK_LOCATION_KEY
Thanks
![Smile :)](./images/smilies/icon_smile.gif)
![Smile :)](./images/smilies/icon_smile.gif)
![Sad :(](./images/smilies/icon_sad.gif)
![Sad :(](./images/smilies/icon_sad.gif)
![Confused :?](./images/smilies/icon_confused.gif)