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

Output file with customized timestamp

Comments

4 comments

  • Avatar
    Gerry Mullin

    You can achieve this with python's os module. You can write out the file to some generic file name and then clock the output node to a Generate Data node and immediately rename (os.rename) it with some manipulated value. Screenshot of a simple example attached.

     

    Attached files

    rename.png

     

    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    If you are using Data360 Analyze v.3.5.1 or above you can use the PathSafe set of built-in Run* property values which are the replacement for Current* run properties. See the following topic in the Help documentation 

    'Advanced topics' > 'Using derived property values' > 'Run property substitution'

    This information is also available online for the latest version of the product here.

    https://d3sa-preview.infogixsaas.com/docs/dist/help/Default.htm#d-advanced-topics/substituting-run-properties.htm

     

    0
    Comment actions Permalink
  • Avatar
    Ron Li

    Thanks Gerry and Adrian! Ya, I find that Data360 Analyze v.3.5.1 has the path safe properties for timestamp. However, I have to stick to v.3.5.0 for enterprise purpose. Regarding Gerry solution, it works totally fine via running the entire process manually. However, I try to schedule the process and find that there may have arbitrary failures on the Generate Data node.

    Error Code: brain.nodes.script.jython.scriptExecError

    ERROR:OSError:(0,"Couldn't rename file") Error Executing "CreateRecords" at line "10"

    Line 10 : os.rename(genName, newFileName)

    Is it the OS level access right problem? But I can run the process successfully sometimes.

    For example, I have 3 batches(5pm,530pm,6pm) running for 3 days, there may  be none, 1 or 2 times of success, out of 3 day.

     

    Thank you so much for helping.

    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    When scheduled, do you have multiple data flows running at the same time? The file name of the temporary file that is created by the Output Excel node (e.g. GenericName.xlsx in Gerry's example) needs to be unique else it could be deleted (or overwritten) by another scheduled data flow execution.

    0
    Comment actions Permalink

Please sign in to leave a comment.