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.  Suffix .xls filename with current date and time

    Employee
    Posted 07-22-2012 21:22

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

    Originally posted by: credoblado

    I need to suffix the output filename of an .xls with the current date and time.
    Is there are parameter for current time? Similar to {{^CurrentDate^}}?
    If none, what is the best way to code this?


  • 2.  RE: Suffix .xls filename with current date and time

    Employee
    Posted 07-23-2012 08:01

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

    Originally posted by: stonysmith

    There's not exactly a clean way to do this in a single step.

    What I do is write out the xls with a 'dummy' name, and then I use the moveFile function inside a filter to rename it:

    node:Static_Data
    bretype:core::Static Data
    editor:sortkey=500d64bf44714e62
    output:@40fe6c55598828e5/=
    prop:StaticData=<<EOX
    FileName:string
    c:\documents and settings\username\desktop\myworksheet_current.xls
    EOX
    editor:XY=130,160
    end:Static_Data

    node:Filter
    bretype:core::Filter
    editor:sortkey=500d64f4190e4883
    input:@40fd2c74167f1ca2/=Static_Data.40fe6c55598828e5
    output:@40fd2c7420761db6/=
    prop:Script=<<EOX
    stamp = timestamp().str().replace("-","").replace(":","").replace(" ","")
    NewFile=Filename.replace("current",stamp)
    emit *,NewFile
    moveFile(Filename, NewFile)
    EOX
    editor:XY=220,160
    end:Filter


  • 3.  RE: Suffix .xls filename with current date and time

    Employee
    Posted 07-23-2012 16:24

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

    Originally posted by: credoblado

    Thanks ...this works