If it's a single value, then the best approach might be global
variables.  I'm not sure how this would work with an
AttributeFileReader, but the following would work if you know the name
of the text file you are reading before the translation starts.

First, make sure that you are using a "Text File" source data set, and
that it is higher in the Workspace screen than your shapefile reader.

Next, attach a GlobalVariableSetter to the end of this stream when you
have an attribute containing the value you want to add to all the
features

Finally, attach a GlobalVariableRetriever to the shapefile data stream
to attach this global value as an attribute.

Jason

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of
jamison_leach
Sent: Tuesday, October 03, 2006 09:01
To: [email protected]
Subject: [fme] Populating a shapefile attribute with a value from an
external text file

Good morning,

     In Workbench, I have successfully extracted a text string from an
input text file. I now need to add this text string for every record of
an attribute in a shapefile. For example, if the text file contains one
long text string relating to road condition, I extract just the portion
that reads either 'paved', 'gravel', or 'dirt'. So, if the file contains
'paved', I'd need to add 'paved' to every record in the "Road Surface"
attribute of my shapefile. Does anyone know a good way to approach this?
I successfully wrote out the text string (such as 'paved') to an output
file using the AttributeFileWriter, but using the AttributeFileReader to
read the text string in to the shapefile's "Road Surface" attribute
didn't work, perhaps because the the file written by the
AttributeFileWriter only comes into being once I run the procedure in
Workbench.

Regards,
JD


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.

Slides from the "Road Ahead" address from Day 2 of the FME Worldwide Users 
Conference outlines enhancements planned for FME 2007. To view these slides, 
visit www.safe.com/2006uc.

 
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/
 


Reply via email to