Parsing a string into multilple columns
Posted: Wed Nov 30, 2011 7:41 pm
Hi
Input is a delimited file as below
KEY_COL|ATTRIBUTE_NAME_2|ATTRIBUTE_VALUE_4
sonj2|USER PRIVILEGES DESC|useradmin+route+suppress+reportadmin
Expected output- wants to create multiple rows for each KEY_USER according to attribute values associated with it.
KEY_COL ATTRIBUTE_NAME_2 ATTRIBUTE_VALUE_2
sonj2 USER PRIVILEGES DESC useradmin
sonj2 USER PRIVILEGES DESC route
sonj2 USER PRIVILEGES DESC suppress
sonj2 USER PRIVILEGES DESC reportadmin
Used column import and pivot stage to achieve, output result. However can exist more or less for other KEY_USER, this dynamic part is becoming limitation.Is there any way to handle this dynamic part?
Used Field and Index function but how to increase the counter of delimiter position?
Used Convert function and CHAR(10) but the result is in one row.
Input is a delimited file as below
KEY_COL|ATTRIBUTE_NAME_2|ATTRIBUTE_VALUE_4
sonj2|USER PRIVILEGES DESC|useradmin+route+suppress+reportadmin
Expected output- wants to create multiple rows for each KEY_USER according to attribute values associated with it.
KEY_COL ATTRIBUTE_NAME_2 ATTRIBUTE_VALUE_2
sonj2 USER PRIVILEGES DESC useradmin
sonj2 USER PRIVILEGES DESC route
sonj2 USER PRIVILEGES DESC suppress
sonj2 USER PRIVILEGES DESC reportadmin
Used column import and pivot stage to achieve, output result. However can exist more or less for other KEY_USER, this dynamic part is becoming limitation.Is there any way to handle this dynamic part?
Used Field and Index function but how to increase the counter of delimiter position?
Used Convert function and CHAR(10) but the result is in one row.