In Ab Initio graph I have an input file which has pipe-delimited values in rows. I use similar DML file to parse it:
record
decimal("|",0, maximum_length=19, sign_reserved) v1 = NULL("");
utf8 string("|", maximum_length=10) v2 = "";
utf8 string("|", maximum_length=10) v3 = "";
utf8 string("|", maximum_length=40) v4 = "";
utf8 string("|", maximum_length=255) v5 = "";
utf8 string("\n", maximum_length=40) v6 = "";
end
For use in later equality comparisons with other data I want to make all those strings pipe-delimited, so I need to change v6 value.
I tried do it with simple Reformat by changing output DML to this one, and leaving the transform function empty:
record
decimal("|",0, maximum_length=19, sign_reserved) v1 = NULL("");
utf8 string("|", maximum_length=10) v2 = "";
utf8 string("|", maximum_length=10) v3 = "";
utf8 string("|", maximum_length=40) v4 = "";
utf8 string("|", maximum_length=255) v5 = "";
utf8 string("|", maximum_length=40) v6 = "";
string(1) newline = "\n";
end
However, this left trash character inside v6. Later I needed to filter v6 value to make it only contain proper characters. This solution doesn't seem neat.
To avoid this trash left inside v6 I tried to use reinterpret_as, string_concat and others but nothing ended up with a nice solution. How should I change the delimiter of v6 in a simple way?