LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  trying to change a field name with wierd characters

    Employee
    Posted 03-25-2015 04:04

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: dhrobertson

    hi all,
    I have a field name that comes through from SAP with these 3 characters prefixing the name of the field. the issue is when I try and rename the field of use the field, Lavastorm doesn't seem to like those characters and thus cant find the field to do anything with it. I previous have got round this by hardcoding a new field name in the delimited acquisition node which then moves the dodgy character field to line one of the dataset. I then do an execcount to create line numbers and then emit * other than line 1.
    the problem with this is the fact I have hard coded the fieldnames. if a field in the raw input is removed or another added, it will affect the running of the node. I'm trying to dynamically find a way to rename this field but have struggled so far. tried a metadata node to pivot the names, change the fieldname and pivot back to headers but I still need to reference this weird field name in order to move the data from one field to another.
    I have tried adding the characters in the list of escape characters and it gets rid of �� but it doesn't get rid of �

    any ideas of how I can go about this?

    the field comes through from source as

    ���CUSTOMER_NAME


    thanks

    douglas


  • 2.  RE: trying to change a field name with wierd characters

    Employee
    Posted 03-25-2015 04:21

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ltolleson

    Try the code below. Just copy and paste all of the text below the line into your graph. I think this should work for this situation.

    The ModifyFieldPrefix node will allow you to ADD or REMOVED a PREFIX from field names.
    ----------------------------------------------------------------------------------------------------------------------------
    node:Static_Data_6
    bretype:core::Static Data
    editor:sortkey=55129a0c56fe499c
    output:@40fe6c55598828e5/=
    prop:StaticData=<<EOX
    ���CUSTOMER_NAME
    test
    12
    a
    b
    c
    EOX
    editor:XY=680,420
    end:Static_Data_6
    node:Modify_Field_Prefix
    bretype:core::Modify Field Prefix
    editor:sortkey=55129a3c6db95d61
    input:@454a22da07433364/=Static_Data_6.40fe6c55598828e5
    output:@454a22dc003534d6/=
    prop:Add=false
    prop:Prefix=���
    editor:XY=810,420
    end:Modify_Field_Prefix


  • 3.  RE: trying to change a field name with wierd characters

    Employee
    Posted 03-25-2015 04:47

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: dhrobertson

    thanks Larry,

    I have used that as well and it removes 2 of the characters but the >> character is being stubborn. If I copy and paste like I did in this query, I agree it works, but from this file itself it doesn't want to go.


  • 4.  RE: trying to change a field name with wierd characters

    Employee
    Posted 03-25-2015 04:48

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: dhrobertson

    appologies... I take that back. it does seem to have worked. thanks
    doug


  • 5.  RE: trying to change a field name with wierd characters

    Employee
    Posted 03-25-2015 04:59

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ltolleson

    Glad it worked! I know how stubborn data can be sometimes.


  • 6.  RE: trying to change a field name with wierd characters

    Employee
    Posted 03-31-2015 17:49

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    Oh, interesting! I didn't think anything of this initially, but that ��� just looked too familiar. In case you're curious, that's coming in from a Byte Order Mark (BOM) at the beginning of a file. If you have control over how the data is saved, saving it without BOM will prevent that string from being loaded.