Question

Use AttributeSplitter with a Carriage Return

  • 16 February 2013
  • 4 replies
  • 93 views

Userlevel 4
Badge +13
I am trying to split text features that contain a carriage return into two separate pieces of text so I can better control the spacing between the text lines.  I can use a StringSearcher to find the text using the \\r variable.  However, when I try to the use the \\r in the AtrributeSplitter, it will not split it into two separate list elements.  I am using FME2012.

4 replies

Userlevel 3
Badge +17
Hi,

 

 

In FME 2013, we can select special characters including carriage return on Advanced Text Editor when setting the parameter of AttributSplitter. I forgot whether there was such an editor in FME 2012...   Alternatively, how about trying a combination of StringReplacer and AttributeSplitter?  Replace \\r with \\n by StringReplacer (Use Regular Expression = yes), then split the text at \\n by AttributeSplitter.   Hope this helps.  
Badge +2
In FME2012, \\n is the newline character within the AttributeSplitter.

 

 

The reference is as follows:

 

http://fmepedia.safe.com/articles/Samples_and_Demos/AttributeSplitter

 

 

If such doesn't work, also refer to:

 

http://fmepedia.safe.com/AnswersQuestionDetail?id=906a0000000cb1hAAA

 

Userlevel 5
The newline character(s) may vary depending on the input data format and operating system. Unfortunately, it can be rather complicated sometimes, see http://en.wikipedia.org/wiki/Newline for a more complete discussion.

 

 

In FME 2012, the following may work in some cases:

 

  • Open the AttributeSplitter parameters
  • For "Delimiter or Format String", click the button and select "Open Editor..."
  • In the editor window, press the Enter key once (and nothing else) to insert a single newline
  • Click Ok twice

 

Userlevel 4
Badge +13
The option that worked was opening the Editor within the AttributeSplitter and then selecting New line as the String Type. 

 

 

Neither the AttributeSplitter nor the StringReplacer would accept \\r as an input.

Reply