How to use "$" as delimiter when export data as CSV

Hi All,

Currently, I'm working on exporting the data store entity to CSV. I tried to use the "Export DSE to CSV" smart service. and our requirement is to use the $ symbol as a delimiter. However, the smart service only supports the predefined list of delimiters. please refer to the below screenshot.

If I try to use other symbols, I get the following error.
"Invalid csv delimiter $. A CSV delimiter must be one of the following values: "TAB", "COMMA", "SEMICOLON", "SPACE",  "PIPE", "CARET" (APNX-1-4505-027)"

Is there a way to use different delimiter other than the predefined list?

Thanks

  Discussion posts and replies are publicly visible

Parents
  • It looks like those are the only delimiter options you get with that smart service. So if using $ as your delimiter is a deal-breaker then you'll have to implement a multi-step process:

    1. Export to CSV file using one of the delimiter options that the smart service does support. Note: ensure that the character you use isn't used anywhere in the extracted content otherwise the follow steps will change the data as well as the delimiters

    2. Read the CSV file into a variable as text - you can use the readtextfromfile() function that comes with the Text File Utilities plug-in. Note that you'll want to set 'preserveLineBreaks' to true to get a multi-line output.

    3. use substitute() to replace your the OOTB delimiter with your chosen delimiter e.g. substitute(local!fileText, ";","$") if you chose to use SEMICOLON as the OOTB delimiter option

    4. write the updated text to a file. You can use the "Text Doc from Template" smart service and have a very simple template that has a single parameter that gets replaced by the updated text you've generated

    I know, it seems like a heap more work. It would be nice to allow you to choose your own delimiter but that's the constraint you currently have to work within.

  • Thanks, Stewart for the workaround.

    Let me try this and update you about the outcome.
    Thanks

  • Of course my first option would be to challenge the "$" delimiter "requirement"...I've never come across this, it's almost always a comma or a space or a tab or a pipe...

  • 0
    Certified Lead Developer
    in reply to Stewart Burchell

    Yes, you are correct, We are having discussions with the stakeholder who expect this data to be processed from their system. If they agree with with default options. we will go with the out-of-the-box feature. otherwise, I need to build as you suggested.

Reply Children
No Data