LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Dynamically set filename in Output Delimited node

    Employee
    Posted 12-29-2015 10:04

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Orhan

    Hello,

    First of all thanks for taking the time to read this post.

    Let's say I have a simple graph. I have a composite node, within that composite node is a static data node hooked up to an Output Delimited node.

    I want to define composite level parameters that will evaluate to an output folder and an output filename. These would then be used in the Output Delimited node in the File box.

    If I hard set the values, this works - for example, after declaring 2 parameters as string within the composite node, I might have something like:

    Output folder: C:\testfolder
    Output filename: {{^Output folder^}}\testfile.csv

    Then in the Output Delimited node, in the File box I would put {{^Output filename^}}

    Now let's say I want my output filename to contain a sequence of digits; the date and time of current execution. For example, if the date and time now is 29-12-2015 17:01:30, I'd like to first transform these values into a single long value, i.e. 29122015170130. I know this is achievable using Brainscript functions like timestamp. I then want to integrate this number into the filename that gets generated. So if I ran the graph at the date and time specified above, I would get an output filename of:

    C:\testfolder\testfile29122015170130.csv

    This method would ensure that each subsequent run of the graph would generate a unique filename.

    Is this possible to do in Lavastorm? I have been playing around with parameter types, and I see there are some brainscript options like "brainscript", "brainscriptexpr", "brainscriptoutput". I haven't been able to find any help on what these types mean or what they actually do. My initial thought was that if I selected something like "brainscriptoutput", I might be able to define a function in the text box for the parameter which would evaluate and become the parameter value going forwards. For example, I might enter strcat("a","b") and then I was hoping that the parameter would be set to ab - but in fact the parameter is literally set to strcat("a","b").

    Any input/advice is appreciated.


  • 2.  RE: Dynamically set filename in Output Delimited node

    Employee
    Posted 12-29-2015 10:24

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    Check out this entry: https://infogix.zendesk.com/hc/en-us/community/posts/360050709314


  • 3.  RE: Dynamically set filename in Output Delimited node

    Employee
    Posted 12-30-2015 11:10

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Orhan

    Originally posted by: ryeh
    					

    Thank you, ryeh, that does the trick. Also learned something new about properties in Lavastorm!

    Rather than writing a file and then moving it afterwards to rename it, I think it would be better if LAE could dynamically create file names; perhaps as suggested in my initial post, it could be that one could set a parameter that is resolved using Brainscript.

    I'm not sure if such functionality exists within Lavastorm, but for the purpose of this topic I'm happy that I've found a working solution.