Hi Hoa,
Try using both Feature Type Fanout and Dataset Fanout.
Expose "fme_dataset" of the source dataset (i.e. source file path), and extract parts of the path string with the FienamePartExtractor.
Then, set the fanout options.
1) Feature Type Fanout (Feature Type Properties of the writer feature type)
Fanout By Attribute: _rootname (source file name without extension)
2) Dataset Fanout (writer parameters in the Navigator)
Attribute to Fanout on: _dirname (folder name of the souce file)
Takashi
Hi Takashi,
Thank for your support.
I am using FilenamePartExtractor tool. My parameters look like the below:
Please let me know what you think. Thank you
This image illustrates my intention.
Hi Takashi,
Thank you. I can fanout to subfolder, it's ok. But I see that the input file is .dgn, when I convert to tabfile, the dgn file will extract multiples file tab.
When I use the processing in the above, I got the output is the same input filename, ONLY a layer tabfile.
Could you tell me why and how to do that to get extracted files in the folder?
Thank you
If you need to create tab files for each layer of the source dgn, fanout them on source filename + feature type name (i.e. layer name).
Expose "fme_feature_type" in the reader feature type.
Create new attribute that holds a concatenated string of "_rootname" (filename without extension) and "fme_feature_type" (layer name).
Use the new attribute as feature type fanout attribute.
Hi,Takashi. I'm sorry, a long time I've not follow that. Today, I try to make it.
I saw :
- fanout them on source filename + feature type name (i.e. layer name) means the writer will fanout, right? And
feature type name is fme_feature_type and what's source filename in my photo?
- the column
fme_feature_type like
rootname and
filename.
Could you please explain that again?
Thank you
Hi Hoa,
The physical form of "dataset" and "feature type" are different depending on the data format.
In the DGN format, dataset is a file; feature type is a layer.
In the MITAB format, dataset is a set of files in a folder; feature type is a file.
In a database, dataset is a database; feature type is a table. and so on.
See also here.
FME Workbench > Readers and Writers > Dataset Types (
http://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Desktop_Help.htm#../Subsystems/FME_Workbench/Content/Workbench/dataset_types.htm)
Source folders/files strcture was:
Folder1: file1.dgn (layers?)
Folder2: file2.dgn (layers?)
Folder3: file3.dgn (layers?)
What kind of destination folders/files structure do you need to create?
Takashi
... but your screenshot is strange.
If you have set "fme_dataset" to the Source Filename parameter of the FilenamePartExtractor, the resulting attributes should contain elements of the source file path like this.
Check if the parameter has been set properly.
Hi, Takashi
My raw source is DGN format. They have structures :
For example:
Folder1: A.dgn , B.dgn
Folder2: A1.dgn, A2.dgn
My target is to transformed *.dgn format to *.Mitab file for each .dgn file.
I've know when I transform each .dgn file to .Mitab file, they will create about more 60 tabfile (Name is 1 to 63). So I want to create a new subfolder based on the name .dgn file and make tabfiles into subfolder (A,B, A1, A2).
The structures will be :
Folder1 -> A ->1.tab,2.tab,3.tab....
Folder1 -> B->1.tab,2.tab,3.tab....
Folder2 -> A1 ->1.tab,2.tab,3.tab....
Folder2 -> A2->1.tab,2.tab,3.tab...
I got it.
Assuming that the source folders are located under a folder called "C:\\Root" like this.
C:\\Root
+ Folder1
A.dgn
B.dgn
+ Folder2
A1.dgn
A2.dgn
Try this procedure.
(1) Expose "fme_dataset" (source file path) and "fme_feature_type" (layer name) in the DGN reader feature type.
(2) Extract parts of the source file path with a FilenamePartExtractor.
Source Filename:
fme_dataset
Root Filename Attribute: _rootname
Folder Name Attribute: _dirname
(3) Create a new attribute (e.g. "_fanout_folder") storing dataset fanout folder name (<original folder name>\\<source file name without extension>), using a StringConcatenator or an AttributeCreator.
_fanout_folder = @Value(_dirname)\\@Value(_rootname)
(4) Set "fme_feature_type" (original layer name) to the destination file name in the MITAB writer feature type (in FME 2015.0 or earlier, set "fme_feature_type" to the Fanout By Attribute).
(5) Set Fanout Dataset parameters of the MITAB writer in the Navigator.
Fanout Dataset: Yes
Fanout Folder: C\\Root
Fanout Prefix: <not set>
Attribute to Fanout on: _fonout_folder <-- created in the step (3)
Fanout Suffix: <not set>
correction for a typo.
Fanout Folder: C:\\Root
Dear Takashi,
Thank you so much. Great !