In that example, I'd probably want to see the following as a result rather than a list: length = 7.3 kind = 'paved' lanes = 2
Anyway... I would approach this as follows: - Counter to create unique attribute for each record - Split the datastream (One to AttributeRemover, one to ListRemover) - Stream 1 (AttributeRemover) - AttributeRemover (get rid of extras) - ListExploder to get separate features for each list item - AttributeCreator setting &fieldname = &fieldname - AttributeRemover (get rid of extras) - AttributeAccumulator (group by the Counter) - attach to FeatureMerger Supplier port - Stream 2 (ListRemover) - ListRemover to get rid of the list (which we redefine in the earlier step - attach to FeatureMerger Requestor port - ListSorter by the list element index generated by the ListExploder to make sure that original order is maintained This leaves you with some undesirable elements in the list. I'm not sure how you would clean these up. Also, the AttributeCreator does not translate the &fieldname value for you, so the workspace is a bit confusing unless you know what it's doing. Example attached. Jason ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, November 22, 2005 14:37 To: [email protected] Subject: [fme] List format Hi group, I have a lot of data in this list format: somelist{0}.fieldname = 'length' somelist{0}.fieldvalue = 7.3 somelist{1}.fieldname = 'kind' somelist{1}.fieldvalue = 'paved' somelist{2}.fieldname = 'lanes' somelist{2}.fieldvalue = 2 I want to convert into this list format: somelist{0}.length = 7.3 somelist{1}.kind = 'paved' somelist{2}.lanes = 2 In other words, I want to convert an attribute value into an attribute name. Which is the best strategy to accomplish this task in Workbench and/or FME functions and factories? Thanks to help me, Jean-François Beaudry Technicien en géomatique Hydro-Québec Géomatique, relevés techniques et gestion des données Direction - Environnement et services techniques Direction principale - Expertise Place Dupuis 9e étage Tél. : (514) 840-3000, 855, rue Sainte-Catherine Est poste 4230 Montréal (Québec) H2L 4P5 Téléc. : (514) 840-4233 [EMAIL PROTECTED] http://www.hydroquebec.com <http://www.hydroquebec.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/
list_redefine.fmw
Description: list_redefine.fmw
