Hello all. I have a requirement to concatenate multiple lines of data into a single line. See example below. I have tried solutions in a transformer stage variables with no success. Any help/advise would be greatly appreciated.
Example
Input:
name age address
John|43|1015 main street
Queens
New York 10035 ^
Jackie|51|1015 main street Queens New York 10035 ^
James|50|10 Court LN
Raleigh
North Carolina 12045 ^
Output:
name age address
John|43|1015 main street Queens New York 10035 ^
Jackie|51|1015 main street Queens New York 10035 ^
James|50|10 Court LN Raleigh North Carolina 12045 ^
Concatenate multiple lines of data into a single line.
Moderators: chulett, rschirm, roy
Re: Concatenate multiple lines of data into a single line.
Shell script with a loop.
start of loop:
$line1=read the line from input;
$line2=read the line from input;
$line3=read the line from input;
echo it to the output "$line1 $line2 $line3";
end of loop
if condition the loop to beak out once you reach the end of file.
start of loop:
$line1=read the line from input;
$line2=read the line from input;
$line3=read the line from input;
echo it to the output "$line1 $line2 $line3";
end of loop
if condition the loop to beak out once you reach the end of file.
Re: Concatenate multiple lines of data into a single line.
Thank you so much PaulVL.
I'm hoping for a DataStage solution, as the the resources may not have sufficient skills to support a script solution.
I'm hoping for a DataStage solution, as the the resources may not have sufficient skills to support a script solution.