Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i need some help, i have a input file1 like this:
00;column1;column2;column3;
11;column1;column2;
22;column1;column2;column3;column4;
33;column1;column2;column3;column4;column5;
00;column1;column2;column3;
11;column1;column2;
22;column1;column2;column3;column4;
33;column1;column2;column3;column4;column5;
i have other file2 with column1;column2
i need to replace the value of column3 on the lines that start with 00 doing a join between the 2 files where
file1.column2=file2.column2
maintaining the same lines of file1 at the end with the replaced value- final file.
i thought of using the tfileinputfullrow - file1,thashmap-file 2 extracting and treplace but who can i do a join ? can somebody help me with this issue?
@uzix, you may use a tFileOutputDelimited with a single column schema as soon as you set the Field Separator to a special character which never appears into your file.
Here is how it should look like:
And the result file is like this:
00;column1;column2;column3; 11;column1;column2; 22;column1;column2;column3;column4; 33;column1;column2;column3;column4;column5;
You have a varying number of fields for each record.
hi TRF,
thanks you for your help,
a question, will the schema of the lines be preserved?
"00;column1;column2;column3;
11;column1;column2;
22;column1;column2;column3;column4;"
@uzix, you may use a tFileOutputDelimited with a single column schema as soon as you set the Field Separator to a special character which never appears into your file.
Here is how it should look like:
And the result file is like this:
00;column1;column2;column3; 11;column1;column2; 22;column1;column2;column3;column4; 33;column1;column2;column3;column4;column5;
You have a varying number of fields for each record.
thank you TRF and fdenis,
you both provided me with solutions to my issue.