Question

How can I append two rows of a delimited file?

For example, I have:

a | b | c | d

e | f | g | h

and I want:

a | b | c | d | e | f | g | h

This new file may or may not be saved after the transformation.

Was it helpful?

Solution

Is there any possiblity that you have a join condition or relation between these two rows. Or it is always just two rows, as lets say your file contains 4 rows (how would like to merge them now) a|b|c d|e|f x|y|z m|g|s

if you have a way to relate these rows, then it will be easier using tmap

Ok the information you have shared in comment helps..

try this
tfileinputdelimited_1 (read all rows from file) -->filter_01 (only 'TX' rows)-->tmap(add sequence start with 1,1) so output of tmap will have all columns + sequence_column having value 1, 2, 3..for row 1, row2, row3...and so on..

Similarly have another pipeline tfileinputdelimited_2 (read all rows from file) -->filter_02 (only 'RX' rows)-->tmap(add sequence start with 1,1) so output of tmap will have all columns + sequence_column having value 1, 2, 3..for row 1, row2, row3...and so on..

Now both these pipeline input them to tMap - and join based on sequence column and select all columns you need from them into single output.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top