csv issue

ricky76ricky76 Member Posts: 204
When exporting a csv i want to wrap each field in double quotes. I also want each field to be seperated by a comma. All the information should therfore just be in the first cell. If i concatenate the string with a + ',' it takes this as the field seperator. Is there any way i can achieve what i need to?

Comments

  • gerritgerrit Member Posts: 5
    Set FieldStartDelimiter and FieldEndDelimiter both to <">.
    Set FieldSeparator to ,

    The above settings used in one of my dataports give the result as required.

    Regards,

    Gerrit
  • ricky76ricky76 Member Posts: 204
    Sorry i never made it clear i am using a report and not a dataport. Is it possible in a report?
  • AlbertvhAlbertvh Member Posts: 516
    Hi,

    I am supposing that you are using the WRITE statement so maybe you could do this
    WRITE('""' + FieldA +'","' +...... + '""');
    

    Notice the 2 Double quotes at the beginning and the end.


    Hope this helps

    Albert
  • ricky76ricky76 Member Posts: 204
    Thanks for your help but this has not worked.
  • AlbertvhAlbertvh Member Posts: 516
    Hi,

    Ok just checked again should be wriiten like this
    WRITE('"""A"",""M"",""100.00"""');
    or
    WRITE('"""' + fieldA + '"",""' + fieldB + '"""');
    

    3 double quotes to start and end and 2 on each side of the comma to join

    Albert
  • ricky76ricky76 Member Posts: 204
    That has worked. Thank you very much for your assistance it is most appreciated.
Sign In or Register to comment.