Skip to main content
Question

Isolate text from .csv column


Forum|alt.badge.img
Was wondering if anybody has split text from a .csv column into to seperate columns?

 

 

I have a column named "Coordinates" with x,y data with the word POINTZ before the coordinate.

 

 

Example: POINT Z (-113.807295690 52.269077310 842.30)

 

 

I would like to put just the values in seperate columns (X & Y) containing no text.....

 

 

Once I have the x,y in seperate columns i'm assuming its easy to convert the .csv to a .shp

 

 

Any thoughts

4 replies

takashi
Evangelist
  • August 20, 2013
Hi,

 

 

There are several ways, I would use a StringSearcher with these settings:

 

Attribute: Coordinates

 

Regular Expression: ^.*\\(([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)\\)$

 

Matched Parts Attribute: _coord

 

 

The StringSearcher adds a list attribute (coord{}) to each feature.

 

If "Coordinates" is "POINT Z (-113.807295690 52.269077310 842.30), for example, the list elements will be:

 

_coord{0} = -113.807295690

 

_coord{1} = 52.269077310

 

_coord{2} = 842.30

 

 

Takashi

 


david_r
Celebrity
  • August 20, 2013
Hi,

 

 

the text looks to be in the WKT format. If so, you could use a GeometryReplacer (with "OGC Well Known Text" as format) to convert the text into a geometry. Then use a CoordinateExtractor to get the individual values.

 

 

David

Forum|alt.badge.img
  • Author
  • August 28, 2013
Takashi, I don't seem to be able to get this option to run even though it appears straight forward?

 

 

I do not see the list Attributes that the StringSearcher is supposed to create?  _coord{0}

 

 

I'm a little lost when going from the StringSearcher to the GeoMedia SQL Server Warehouse.

 

 

 

 


Forum|alt.badge.img
  • Author
  • September 9, 2013
Hi Takashi, is their any other way to perform this task, i'm not familiar with this type of coding...

 

 

Also not sure how to implement this code into the the StringSearcher parameters?

 

--Do I use Constant

 

--Do I use multiple StringSearcher Transformers?

 

--Where do you set the _coord{0} . . . ?

 

 

 

Tyler

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