Hi Thomas,
You can use \\n to search for carriage returns.
Owen
y0u can also use hexadecimal approach.
carriage return \\x
0D and linefeed \\x
0A etc.
Many thanks Owen and Gio! The StringSearcher with [\\r\\n\\$,;] works perfectly. Problem solved :)
Kind regards
Thomas
Dollarsign, carriagereturn and linefeeds must be escaped with a "\\".
should be:
Dollarsign must be escaped with a "\\".
carriagereturn and linefeeds: non-printable characters shorthands are (amongst others)
\\t matches a tab character , \\r a carriage return and \\n a linefeed
"\\r" is a carriage return.
"\\xFF" is non-Unicode. "uFFFF" is unicode. (where F s a hexadecimal character)
in "x0D" the "0D" is the ascii code for carriage return in hexadecimal etc.
Hope this satisfies the disgruntlled... ;)
If you don't believe me, look it up on any regexp info site (of wich there are zillions).
I used a TestFilter to examine some CSV data I have where one field contains Carriage Returns and/or Line Feeds. I created separate Output Ports for "Contains RegEx \\r" and "Contains RegEx \\n" which revealed that I had BOTH types in the data. Therefore I need to replace both. So in StringReplacer my Mode is "Replace Regular Expression" and my "Text To Replace" is (\\r|\\n).
Out of 330,000 features, only 73,000 contained CR and/or LF. However, it is 9 seconds quicker to JUST use StringReplacer versus Tester and StringReplacer where the Tester is only sending features to StringReplacer that need fixing.