01-12-2014 11:47 AM
We have one array which contains values and empty strings, what we are trying to do is if 2 or more values are coming continuously we want to concatenate them in one index by setting tab as delimiter, but what is happening is, it is concatenating all the values in one index only even if there is empty string between two indexes.
below i am attaching the code with the input and the expected output and the output that we are getting.
Solved! Go to Solution.
01-12-2014 12:20 PM
Hi,
we made some changes to the code but still not getting the expected solution.
attached below is the new code.
01-12-2014 12:28 PM
If haven't taken a good look but your shift reigster in your FOR loop is being replaced every loop by the single build array and then replacing the previous shift register contents.
Most likely you want to include the previous shift register array contents in your Build Array.
01-12-2014 12:43 PM
tyk007,
Thanks for the reply, can you elaborate little more , because if i am trying t include the previous shift register array contents in build array the output is we are getting values at two indexes for every values that it is concatenating ( one is without concatenation, and at other index with concatenation).
below i am attaching the image of the output we are getting.
01-12-2014 02:23 PM
hi RChoudhary,
your code offers room for simplification e.g.
a shift register may be way too much just to get the i+1 element of your input array. How about the index array function and the increment +1 primitive?
Regards,
Alex
01-12-2014 02:53 PM
Alex,
It is almost always better to use Replace Array Subset than Insert into Array, especially in a loop. Using Replace Array Subset also allows elimination of the concatenation of a 3-element empty array.
The Empty String/Path? comparsion checks directly for an empty string.
RChoudhary,
You mention using a tab as a delimiter but have line feed (new line) wired into your code. Which do you really want?
Lynn
01-12-2014 03:01 PM
Hi Johnsold,
I am using linefeed as delimiter only, by mistake i wrote tab.
Thanks for the solution.