Question

Splitting out an Angle field

  • 21 March 2013
  • 4 replies
  • 3 views

There may be an obvious answer but it's escaping me right now. I converted an angle field using the AngleConverter from Decimal Degrees to DDMMSSSS. What I want to do is split split those values out so that I can put the DD in one column of the target, MM in another, and SSSS in another. There's no delimiter so using the AttributeSplitter didn't seem to be the answer. If anyone has any advice, that'd be great. 

 

 

Thanks!

4 replies

Userlevel 4
Badge +13
Hi Sam,

 

 

Dont have FME here to test it, so I'll state the obvious....Did you try the AttributeSplitter with DM and MS as special characters?

 

You can regroup the list elements into columns by diferents list transformers.

 

Hope this helps 
Userlevel 4
Hi,

 

 

take a look at the SubstringExtractor, it will allow you to split a string at a given position.

 

 

David
Userlevel 4
Hi,

 

 

come to think of it, you might want to add a StringFormatter before the SubstringExtractor to make sure that the input string always contains the same number of digits (i.e. to add one or two leading zeros where degrees < 100).

 

 

Example: The format string "09d" will ensure that your input to the SubstringExtractor is alway 9 digits.

 

 

You can then use the following values in the SubstringExtractor to split it up:

 

 

0-2: DDD

 

3-4: MM

 

5-8: SSSS

 

 

David
That last one worked perfectly. Thanks all!

Reply