Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I have a requirement where I have data in this format
A | 1,2,3 |
B | 4,5,6,7 |
C | 8,9 |
and I'd like to change it to
A | 1 |
A | 2 |
A | 3 |
B | 4 |
B | 5 |
B | 6 |
B | 7 |
C | 8 |
C | 9 |
I also have to factor in that I do not know how many values will be present in the second column for me to do a for loop with a constant number of iterations. How can I implement this?
No need for a loop!
You can use the SubField-function to achieve this, eg:
TEST:
LOAD
FIELD1,
subfield(FIELD2, ',') AS FIELD2;
Load * inline [
FIELD1 FIELD2
A 1,2,3
B 4,5,6,7
C 8,9
](delimiter is '\t');
Should lead to this
No need for a loop!
You can use the SubField-function to achieve this, eg:
TEST:
LOAD
FIELD1,
subfield(FIELD2, ',') AS FIELD2;
Load * inline [
FIELD1 FIELD2
A 1,2,3
B 4,5,6,7
C 8,9
](delimiter is '\t');
Should lead to this