We recommend switching to the latest versions of Edge, Firefox, Chrome or Safari. Using Internet Explorer will result in a loss of website functionality.

Create Data Node - Removing Characters

Comments

4 comments

  • Avatar
    Adrian Williams

    Hi Shawn,

    Some characters have special meaning within a Creat Data node as they are control characters for the formatting of the data.

    It is necessary to have a second repeat of a double quote character for it to be interpreted as a literal double quote character.

    If a data element contains the defult field delimiter character - a comma - then the data element text needs to be enclosed in double quotes:

     

    If your data is tab-delimited the FieldDelimiter property should be set to \t  in this case it is not necessary to have the data element enclosed in double quotes (provided it does not include any comma characters)

     

    If the data elements include backslash characters, they must be escaped by including a second backslash character:

     

     

    Regards,

    Adrian

    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    If your data is to be output in a single field and in a single record you could also consider using the Input Static node which does not interpret the text entered into the StaticData field. This means you would not need to escape the backslash characters

    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    If you want to be able to choose a file with a File Picker dialogue rather than enter it manually, you can define a property on a Generate Data node (or a Transform node) and use the property substitution functionality to access the property value from within your Python script:

    In this case the substitution of the File Name property is performed using {{^Property_Name^}}  

    As the value needs to be interpreted as a string the value is enclosed in double (or single) quotes  "{{^Property_Name^}}"

    The opening double quote is preceeded by the r character to indicate the string is 'raw' and Python should not interpret any special characters in the string e.g. backslash characters.

    In this example the property substitution also includes an optional default value "{{^Property_Name=Default_Value^}}"

    See the Help documentation for details of using derived property values

    https://d3sa-preview.infogixsaas.com/docs/dist/help/Default.htm#d-advanced-topics/using-derived-property-values.htm

     

    0
    Comment actions Permalink
  • Avatar
    Shawn Wolverton

    Perfect.  It worked.  I would have never thought to use a double slash.  Thanks also for the bonus tips, I appreciate your assistance.

    0
    Comment actions Permalink

Please sign in to leave a comment.