Clarity

 View Only
  • 1.  Gel Script: creating CSV file starts with #

    Posted Jun 29, 2020 11:01 AM
    Hello everyone, i am curios if anyone else has seen this issue and how to resolve it. I am creating a export CSV that will be imported into another application. I am able to create the CSV file through GEL, but I am running into a kind of dumb issue that I am not sure on how to resolve. The CSV file starts with a '#' symbol in the first field. For the integration, they need that character to be removed as it is causing an error in their system. 

    The coding i am using to create the file is: 

    <gel:parameter default="C:\Share" var="filePath"/>
    <gel:parameter default="Clarity_CapLabor.csv" var="fileName"/>

    <file:writeFile fileName="${filePath}${fileName}" delimiter="," embedded="false">
    <!-- Add a comment header to the file -->
    <file:comment value="JournalKey,..."/>


    However, first field is showing:
    # JournalKey

    Has anyone seen this before? If so, does anyone have a way to clear out the first character or prevent it from populating?

    Thank you





  • 2.  RE: Gel Script: creating CSV file starts with #
    Best Answer

    Posted Jun 29, 2020 12:37 PM
    Edited by croscn Jun 29, 2020 01:01 PM
    Isn't the '#' just the comment identifier, generated from this line;

    <file:comment value="JournalKey,..."/>


  • 3.  RE: Gel Script: creating CSV file starts with #

    Posted Jun 29, 2020 12:47 PM
    Well, now i fell dumb. Thank you David.

    For anyone else, i changed:
         <file:comment value="JournalKey,..."/>

    into
         <file:line>
         <file:column value="JournalKey,..."/>
         </file:line>


  • 4.  RE: Gel Script: creating CSV file starts with #

    Posted Jun 30, 2020 04:19 AM
    :)

    yeah, file:comment is used to add comments to your output file, file:line is used to add the actual data.

    (think that this link is the latest (but it has not changed in many years) documentation on how all that works ; https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/business-management/clarity-project-and-portfolio-management-ppm-on-premise/15-8-1/reference/xml-open-gateway-xog-development/xog-gel-scripting/xog-gel-tag-library/xog-file-tag-library.html )