Skip to main content
Question

Use AttributeSplitter with a Carriage Return

  • February 16, 2013
  • 4 replies
  • 543 views

fmelizard
Contributor
Forum|alt.badge.img+17
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

takashi
Influencer
  • February 17, 2013
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.  

Forum|alt.badge.img+4
  • February 18, 2013
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

 


david_r
Celebrity
  • February 18, 2013
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

 


fmelizard
Contributor
Forum|alt.badge.img+17
  • Author
  • Contributor
  • February 18, 2013
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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings