Dear David,
this is very much a problem I (still) use to solve with mapping files
rather than workbench, simply because workbench does not support
Relational Table Data format so far. If you have fixed column lengths
than the problem is quite easy to solve. I have added a mapping file
extract that might do what you need. It is an extract of something
longer, I tested it quickly and it worked. The only thing you have to
do is define your input and output fields according to your
specifications, please refer to the manual for the keyword definitions
("Readers and writers" ==> "ESRI Shapefile ..." for output
resp. "Relational Table Reader/Writer" ==> "Reader Overview"
==> "Reader Keywords" ==> ASCII Field Types" for input). The current
example allows you even to combine points to lines if consecutive
points have same point ID "N". You can save the file as,
say, "dat2shp.fme" and then start it from the Universal translator
where you enter the input mask (or even from a shell command line
as "fme dat2shp.fme --InpFil filename --ShpPnt ...").
I hope that helps!
Kind regards, Wolfgang
==================== Mapping file example
# ASCII-Data with geometry and attributes to ESRI/Shape
READER_TYPE TABLE
READER_KEYWORD INP
WRITER_TYPE SHAPE
WRITER_KEYWORD OUT
# Macros for input over command line
DEFAULT_MACRO InpFil C:\dummy\x.inp
DEFAULT_MACRO ShpPnt C:\dummy\p.shp
DEFAULT_MACRO ShpLin C:\dummy\l.shp
DEFAULT_MACRO ShpPol C:\dummy\f.shp
# These lines are for interactive input
GUI TITLE Translate ASCII-Data to ESRI/Shape
GUI FILENAME InpFil Daten-Files(*.*)|*.* Input data set with geometry
(fields: X,Y,Z) and attributes (InpFil):
GUI FILENAME ShpPnt SHAPE-Files(*.shp)|*.shp|All_files(*.*)|*.* Data
set for SHAPE-point data (ShpPnt):
GUI FILENAME ShpLin SHAPE-Files(*.shp)|*.shp|All_files(*.*)|*.* Data
set for SHAPE-line data (ShpLin):
GUI FILENAME ShpPol SHAPE-Files(*.shp)|*.shp|All_files(*.*)|*.* Data
set for SHAPE-area data (ShpPol):
MACRO InpDir "[EMAIL PROTECTED](DIRNAME,$(InpFil))]"
MACRO InpNam "[EMAIL PROTECTED](FILENAME,$(InpFil))]"
INP_DATASET "$(InpDir)"
MACRO PntDir "[EMAIL PROTECTED](DIRNAME,$(ShpPnt))]"
MACRO PntNam "[EMAIL PROTECTED](ROOTNAME,$(ShpPnt))]"
OUT_DATASET "$(PntDir)"
MACRO LinDir "[EMAIL PROTECTED](DIRNAME,$(ShpLin))]"
MACRO LinNam "[EMAIL PROTECTED](ROOTNAME,$(ShpLin))]"
OUT_DATASET "$(LinDir)"
MACRO PolDir "[EMAIL PROTECTED](DIRNAME,$(ShpPol))]"
MACRO PolNam "[EMAIL PROTECTED](ROOTNAME,$(ShpPol))]"
OUT_DATASET "$(PolDir)"
# Define input structure for ASCII
INP_DEF point ASCII "$(InpNam)" \
N char(8) X float(12,3) Y float(12,3) Z float(8,3) \
AS_LINEEND{1} AS_SPECIAL
OUT_DEF $(PntNam) SHAPE_GEOMETRY shape_pointz N char(8) X number
(12,3) Y number(12,3) Z number(8,3)
OUT_DEF $(LinNam) SHAPE_GEOMETRY shape_polylinez N char(8) X number
(12,3) Y number(12,3) Z number(8,3)
OUT_DEF $(PolNam) SHAPE_GEOMETRY shape_polygonz N char(8) X number
(12,3) Y number(12,3) Z number(8,3)
TCL puts {"FME: Translate ASCII-Data to ESRI/Shape"}
TCL puts {"FME: Input data set : $(InpFil)"}
TCL puts {"FME: Output point data: $(ShpPnt)"}
TCL puts {"FME: Output line data : $(ShpLin)"}
TCL puts {"FME: Output area data : $(ShpPol)"}
TCL puts {------------------------------------------------------------
-------------------}
# --------------------------------------------------------------------
-----
# ASCII-Data set
FACTORY_DEF * TestFactory
\
FACTORY_NAME "Dat: Eliminate empty lines "
\
INPUT FEATURE_TYPE point
\
BOOLEAN_OPERATOR OR
\
TEST &X = ""
\
TEST &Y = ""
\
OUTPUT FAILED FEATURE_TYPE *
FACTORY_DEF * TeeFactory
\
FACTORY_NAME "Dat: Set coordinates "
\
INPUT FEATURE_TYPE point
\
OUTPUT FEATURE_TYPE point
\
@XValue(&X) @YValue(&Y) @ZValue(&Z)
FACTORY_DEF * ConnectionFactory
\
FACTORY_NAME "Dat: Combine points "
\
INPUT FEATURE_TYPE point
\
FEATURE_CONNECTION ORDERED
\
BREAK_BEFORE_FIELD_CHANGE N
\
OUTPUT LINE FEATURE_TYPE *
\
@SupplyAttributes(fme_geometry,fme_line)
\
OUTPUT POLYGON FEATURE_TYPE *
\
@SupplyAttributes(fme_geometry,fme_polygon)
\
OUTPUT POINT FEATURE_TYPE *
\
@SupplyAttributes(fme_geometry,fme_point)
# --------------------------------------------------------------------
-----
FACTORY_DEF * TeeFactory
\
FACTORY_NAME "Shp: Points "
\
INPUT FEATURE_TYPE * fme_geometry fme_point
\
OUTPUT FEATURE_TYPE $(PntNam)
FACTORY_DEF * TeeFactory
\
FACTORY_NAME "Shp: Lines "
\
INPUT FEATURE_TYPE * fme_geometry fme_line
\
OUTPUT FEATURE_TYPE $(LinNam)
FACTORY_DEF * TeeFactory
\
FACTORY_NAME "Shp: Polylines "
\
INPUT FEATURE_TYPE * fme_geometry fme_polygon
\
OUTPUT FEATURE_TYPE $(PolNam)
INP *
OUT *
==================== End of mapping file example
--- In [email protected], "Ethridge, David" <[EMAIL PROTECTED]> wrote:
>
> Dear FME group
>
>
>
> This seems like it should be straight forward and easy but I'm
stumped.
>
>
>
> I have a text_line source data (10 records) and arcview
destination. I
> use three substring extractors to parse out id, lat, lon (from many
> other unwanted fields), then go into a 2dpointreplacer. But I end up
> with 30 (bad) records instead of 10.
>
>
>
> So each substring extractor is creating 10 output features. How to
I
> get the each value parsed form the text record into a single output
> record?
>
>
>
>
>
> David Ethridge
> GIS Programmer
> Programming and Project Services
> Claritas Inc.
> _________________________________
> 53 Brown Rd.
> Ithaca, NY 14850
> Direct 1 607 266 3112
> Tel 1 607 257 5757
> Fax 1 607 266 0891
> www.claritas.com
>
For insights into what's up at Safe Software and what's on the development
horizon, visit Safe's blog at spatial-etl.blogspot.com.
Love FME? Then open your diary to March 6-7, 2008 and write this... "Second
Worldwide FME User Conference - Must Attend!" See
http://www.safe.com/company/fmeuc2008/index.php for more details.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/fme/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/fme/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/