Hi just a comment to Jasons mail
rather than using a regular exprsion why not use the 'flile dirname' command from tcl in the tcl caller type in this expresion file dirname [FME_GetAttribute fme_dataset] NOTE this command will convert \ into / but i dont think its a problem for fme. TCL normaly use / as a directory seperator and the \ as an escape character, making it 'interesting' to work with files in tcl on a windows machine. if you want the windows version use this command file nativename [file dirname [FME_GetAttribute fme_dataset]] Peter Laulund National Survey and Cadastre, Denmark >From: "Jason Birch" <[EMAIL PROTECTED]> >Reply-To: [email protected] >To: <[email protected]> >Subject: RE: [fme] FME -how extract source dataset directory attribute >Date: Fri, 24 Jun 2005 13:22:22 -0700 > >Make sure you do this on a test directory structure first. This works >for me, but comes with no guarantees :) > >In Workbench, you will need to expose a format attribute to get at this >information. > >Open up the properties on the a source feature type, click on the >properties ellipsis (or right-click and select "Properties"). Click on >the "Format Attributes" tab and then check off the fme_dataset >attribute. If you have multiple source features, click on the "Apply to >All" button so that they all have this attribute exposed. > >You can extract the path from the fme_dataset with a Grepper. Go into >the Grepper properties, Select the fme_dataset as the attribute, and >enter the following for your regular expression: > >^.:\\(.*\\)([^\\]*)$ > >When you click on OK on the Grepper properties, expand the attribute >section on the MATCHED output. Right-click on the _matched_parts{} and >select Expose Element, choosing to expose 2 elements. _matched_parts{0} >will be (most of) the path, and _matched_parts{1} will be the filename. >The attributes fme_basename and fme_type may also be of use to you. > >Once you have these attributes, you can use them to build the attributes >you want to fan out on. > >In your case, you will need to perform some specific steps because the >shapefile format only holds a single geometry type per file. > >- First, you will want to set up destination feature types for each of >the geometry types you expect to process, and set their allowed geometry >accordingly. > >- Second, you will want to make sure that the fme_type attribute is >exposed in all of the source feature types (the first thing you did >above). > >- Third, you may want to run this through a SubstringExtractor with >values of 4 and -1 to get rid of the "fme_" in the type attribute. > >- Fourth, you will want to run this through a Concatenator. You will >want to concatenate the attribute "fme_basename" with the constant "_" >with the attribute "fme_type" (or the resultant attribute from the >previous step if you chose to do it) into a new attribute (let's call it >"tango" for fun). > >- Fifth, you will need to set up a GeometryFilter to place the data into >the correct streams to go to your output features and connect them to >the appropriate features. > >- Finally, you will have to set up your output features to do a feature >fanout on the "tango" attribute. > >You're still not done though... > >Go to the Workspace tab on the left hand side of your screen. Right >click on your shapefile destination dataset (it'll look something like >"filename [SHAPE]" and choose "Fanout Dataset". In "Fanout Prefix", >enter your drive letter like: "D:\". In "Attribute to Fanout on" choose >_matched_parts{0}. Click on OK. > >Once again: Make sure you do this on a test directory structure first. >This works for me, but comes with no guarantees :) > >*** Note for SAFE: I would have actually done the dataset fanout by >making the drive letter an atom in the regular expression rather than >requiring a hard coded value, but the "Fanout Prefix" attribute does not >seem to accept the value &_matched_parts{0}. Also, Fanout Prefix >requires a value, so I couldn't just leave it off and dump the path into >the attribute. *** > >Jason > >-----Original Message----- >From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of >Kemminje >Sent: Thursday, June 23, 2005 23:59 >To: [email protected] >Subject: [fme] FME -how extract source dataset directory attribute > >Dear Sir, > >Could you pls solve my problem........... > >How can I fanout the destination dataset as same as source data set for >ex if i have dgn file in d:\abc\01\*.dgn > d:\abc\02\*.dgn > d:\abc\03\*.dgn > d:\abc\04\*.dgn I have selected all >the *.dgn files from d:\abc directory with sub folder (d:\abc\***\*.dgn) >and I want to translate these dgn files to Esri shape and the >destination directory should be > d:\abc\01\ > d:\abc\02\ > d:\abc\03\ > d:\abc\04\ Now my question is how >can i take attribute for this destination dataset ? what are the >transformers can be used ? > >Please if you can answer to this query please reply to me. Your urgent >reply will be highly appreciated. >Thanks. > >With Best Regards > >Farook Kemminje >PIXEL INFOTEK PVT LTD. >Bangalore > > > > >Get the maximum benefit from your FME, FME Objects, or SpatialDirect via >our Professional Services team. Visit www.safe.com/services for details. >Yahoo! Groups Links > > > > > > _________________________________________________________________ Del din verden med MSN Spaces http://spaces.msn.com Get the maximum benefit from your FME, FME Objects, or SpatialDirect via our Professional Services team. Visit www.safe.com/services for details. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/fme/ <*> 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/
