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

Export to csv

Comments

4 comments

  • Avatar
    Adrian Williams

    Is there an embedded line feed in one of the values?

     

    Here is a version of the logic that I was working on. It also concatenates all the the field values in a record into a single string. The logic handles Null values and provides a choice option of either removing embedded CR and LF characters or generating an error if one is found in the data. 

     

     

    Attached files

    Write_Preformatted_Text_to_CSV.brg

     

    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    The top Output Delimited node in the data flow uses alternative settings for the FieldDelimiter char (BEL) and QuoteCharacter (¬) and does not output the a header record.

    The lower Output Delimited File uses the settings you specified above. However, for it to be a valid file format the Header record should not be written (and possibly the logic upstream changed to generate a header record from the field names)

    0
    Comment actions Permalink
  • Avatar
    Geoff

    there is no linefeed in any lines, your code does the same thing.. the very last line is blank. its like its adding the linefeed char (as it should) on the last row... but that leaves a blank line at the end.

    its like i need to tell it to not add that final LF..

    the system that its getting loaded in is very picky and cannot have ANYTHING after the final row.

     

    *EDIT*

    the extra line might be ok, it looks like that final \n\r is ok and the file loads! fingers crossed!

    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    The Output Delimited node does not provide a control to not output a final empty line.

    You could modify the logic to output the data to a temp file and then use a Python node to read + write the file line by line and, and omit the final empty line:

     

    Attached files

    Write_Preformatted_Text_to_CSV_Picky.brg

     

    1
    Comment actions Permalink

Please sign in to leave a comment.