cancelar
Mostrando los resultados de 
Buscar en lugar de 
Quiere decir: 

Array Manipulation

¡Resuelto!
Ir a solución

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.

 

 

Descargar todos
0 kudos
Mensaje 1 de 7
4.081 Vistas

Hi,

 

we made some changes to the code  but still not getting the expected solution.

 

attached below is the new code.

0 kudos
Mensaje 2 de 7
4.070 Vistas

 

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.

0 kudos
Mensaje 3 de 7
4.060 Vistas

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.

0 kudos
Mensaje 4 de 7
4.052 Vistas

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?

 

or.png

 

 

 

Regards,
Alex

 

Mensaje 5 de 7
4.015 Vistas
Solución
Aceptado por el autor del tema RChoudhary

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

Mensaje 6 de 7
4.001 Vistas

Hi Johnsold,

 

I am using linefeed as delimiter only, by mistake i wrote tab.

 

Thanks for the solution.

0 kudos
Mensaje 7 de 7
3.993 Vistas