Truncating column values in a Modify Rowset task
Posted: Fri Nov 04, 2016 9:26 am
In a project which follows the pattern Read CSV 1 -> Modify Rowset -> Write CSV 2, I am concatenating two fields from CSV 1 with a New Column in the Modify Rowset task, and I need to truncate the resulting string to 30 characters before writing to CSV 2.
I expected that setting the Modify Rowset task's Size parameter would truncate values in the rowset, but that doesn't seem to be the case. Setting the Size parameter to 30 doesn't seem to affect the output at all as values greater than 30 are still written to the output file. What is the purpose of the Size parameter?
I can make this work using the Substring Function, but I have to test for string length greater than 30 characters or the function errors, e.g.
I expected that setting the Modify Rowset task's Size parameter would truncate values in the rowset, but that doesn't seem to be the case. Setting the Size parameter to 30 doesn't seem to affect the output at all as values greater than 30 are still written to the output file. What is the purpose of the Size parameter?
I can make this work using the Substring Function, but I have to test for string length greater than 30 characters or the function errors, e.g.
Code: Select all
Is this the only way to truncate the column in the output?${If(Length(var) > 30,Substring(var,1,30),var)}