i am trying to parse something from html files, but some text in html has linebreak. So when i get text with xpath and write it csv lines writes different rows. How can i remove all line breaks after get text from xpath node.
Usually you should be able to replace linebreaks in Strings with a Regular Expression.
You can use the "String Replacer" Node for that.
- Select the String column to replace
- Use the Regular Expression Option.
- Enter \n in the field Pattern.
- Select the Replacement Text or just enter a single whitespace
- Select Option "all occurrences"
If the pattern \n does not work as expected you can also try [\r\n]+ which should work for all plattforms (Win/Mac/Linux).
It doesn’t work and my csv has few cells which has data in multiline so I trying to remove those next lines and put it as one cell back agian. But it doesn’t change anything.
Hello Desh, noticed we are having a similar problem. However when I checked again, I found I was assuming the native checkboxes were in place, regular expression is not selected by default. Once I opened it again i realized i had not actually selected regular expression, and due to it being wildcard, it’s still successful. Hope this helps someone wondering if \n is working in the string replacer node.
Here’s the settings that will work.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.