Results 1 to 7 of 7

Thread: Using one input as columns names for another

  1. #1

    Default Using one input as columns names for another

    Hi All,

    I have a data source where the field names are 6 character keys. I have another data source where these keys are mapped to descriptive names.

    I would like to convert the field names from keys to the descriptive names from the other file.

    Currently, the only way I can see to do this is to write a python script similar to rotate but takes two inputs and writes one output.

    Is there a simpler way? Am I missing something?

    Thanks a million for any help.
    Mike

  2. #2
    Contributor
    Join Date
    Dec 2006
    Location
    Boston
    Posts
    485

    Default Re:Using one input as columns names for another

    Mike, currently, you are correct. You would write something very similar to Rotate, with two inputs. If you need some assistance with this node, please post here and someone can help you with that.

    While you have access to the names of inputs with inputFields, and you could iterate over those values, we don't allow the rename statement to occur inside a while loop, and the rename statement takes a constant string.

    In the future, a node such as you are describing could be included in one of our libraries, so I am interested in how it works out, and what your interface to the node ended up being.

    Cheers
    Rich

  3. #3

    Default Re:Using one input as columns names for another

    Thanks for that Rich. Unfortunately I have been a bit side tracked so I'll let you know how I get on as soon as I get back to it.

    Thanks again,
    Mike

  4. #4
    Contributor
    Join Date
    Dec 2006
    Location
    Boston
    Posts
    485

    Default Re:Using one input as columns names for another

    I have attached a graph with a node that should do what you want. Let me know how this works for you. It is called Rename Fields, and you can use it, I believe, as you described. I show an example in the graph section.

    Cheers
    Rich<br><br>Post edited by: rboccuzzi, at: 2009/06/24 17:14
    Attached Files Attached Files
    Last edited by rboccuzzi; 08-19-2009 at 08:39 PM.

  5. #5

    Default Re:Using one input as columns names for another

    Hi Rich,

    I finally got around to using it and it worked perfectly for me. Thanks a million for that, its much appreciated.

    Thanks again,
    Mike

  6. #6
    Lavastorm ANZ
    Join Date
    Jun 2007
    Location
    Melbourne, Australia
    Posts
    58

    Default

    Just stumbled across this post and realised that we need to do the same field name mapping at MDS with data extracted from DISE DB tables.
    Another solution has been built and used over here, but Rich's "Rename Fields" node is a more elegant and efficient solution.
    Thanks Rich :-)
    Cheers,
    Mars
    Last edited by mermacora; 08-28-2009 at 03:52 PM. Reason: typo

  7. #7
    Larry Tolleson ltolleson's Avatar
    Join Date
    Nov 2006
    Location
    Dallas-Fort Worth
    Posts
    189

    Default

    I was in the process of building the same type of node, but ran into this one that you had created. Works perfectly.

    Thanks,
    Larry

Similar Threads

  1. Space between column names
    By saravan in forum Data Acquisition
    Replies: 6
    Last Post: 12-02-2011, 08:32 AM
  2. Joining Dissimilar Field Names
    By Wayne Smith in forum Nodes
    Replies: 2
    Last Post: 11-11-2011, 10:20 PM
  3. Pivot - Data to Names
    By mwillett in forum Nodes
    Replies: 2
    Last Post: 10-17-2011, 12:26 PM
  4. Duplicate Field Names
    By Pooja in forum Nodes
    Replies: 3
    Last Post: 07-06-2011, 07:49 PM
  5. column names in non-conventional codepages
    By Andrey Kateshov in forum Nodes
    Replies: 3
    Last Post: 06-15-2011, 01:00 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •