I am having isues trying to replace a specific character in a string based upon its position, for example in the following string:
C.R.P.R.L.C.K.H.C.R.X.R.L.F I would want to replace the 9th character (L) with “N”.
I have been messing aroung with String Manipulations and Column Expressions and I can identify the 9th character easily enough, but I am struggling to replace only that character in a manner that would be automated and reproducible over many different strings.
So I was hoping some members of the comunity might provide some inspiration…
Thank you for your reply, yes, that would work, but I think it creates a solution that is quite manual, because you have to (as far as I am aware) name columns in cell splitter by positions.
For my problem I might also have strings where I want to replace characters in different positions, or even multiple characters in a string (and I have 120,000 strings).
So I think I would need a way to automate the naming of the columns in the Cell splitter and then identify them in the String replacer (although I think I could do that with variables).
@James_Longden you can create dynamic solutions with knime. What would be best is if you mention your whole challenge possibly with sample data representing your‘s before people start solving just part of your problem.
You might work with meta lists of what you want to replace. One thing to do is rename a column to a standard name and after the manipulation rename it back.
Maybe you can create an excel file with the rules of your replacements in technical terms. And a sample of values you want to manipulate.
Try this. The component allows you to input the change character(s) and starting position. No other manual changes to the workflow are required. @mlauber71 is right. You need to be more explicit about your data structure and what you want to do. Making multiple, arbitrary changes to the same table would be quite a task.
Just wanted to say thank you for all of the excellent suggestions, in the end I used ActionAndi’s string manipulation idea inside a recursive loop to update the position. Worked perfectly!