I am using FME Desktop 2013, Build 13448 to try and complete the following workflow.
Read in CSV's from a directory; as these have have differing numbers and names for attribute fields, before I complete the required processing. NOTE that all input files will have the 3 required I need even if they are named differently (extra fields can be ignored). I had planned to create a lookup.csv to manage the mappings and then use the schema mapper to read in the Survey CSV and the lookup csv and then create an output with only the 3 required fields with the new names. However, I must be doing something wrong as it is not working as imagined.
Input Survey examples:
File1 Schema
EAST,NORTH,HEIGHT
File2 Schema
easting,hei,Nothing,date,time
File3 Schema
X,Y,Z,Time
Lookup,csv
old,new
EAST,NEW_EASTING
easting,NEW_EASTING
X,NEW_EASTING
NORTH,NEW_NORTHING
Northing,NEW_NORTHING
Y,NEW_NORTHING
HEIGHT,NEW_HEIGHT
hei,NEW_HEIGHT
Z,NEW_HEIGHT
expected output
NEW_EASTING,NEW_NORTHING,NEW_HEIGHT
date, time and Time entries would be discarded.
I created the following
1. I have created my lookup table.csv containing field mappings
2. I have configured a CSV reader to read in survey files from a directory, identical schemas set to NO (single merged type)
3. I have hooked up a SchemaMapper straight after the CSV directory reader, I have also pointed it to the lookup csv. In the create actions dialog I have added an attribute map rule, source attribute field (old), destination attribute field (new)
However, the mapped output port does not rename the fields or remove the non required fields. Instead I have an additional _schemamapper_row_ids field populated with 1,2,3,.etc. based on the rows checked.
I have tried changing the additional options in the Attribute Map dialog e.g. default field value and source attribute keep/remove, but to no avail.
Have missed something obvious, if so what?
Looking online there appear to be various version of SchemaMapper with differing setups the one I am using is not the most current.
Regards,
Rob