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.  How to retrieve the date from this Filename?

    Employee
    Posted 05-13-2014 07:07

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

    Originally posted by: johnvvu

    I have a FileName column with the following syntax. I'd like to get the date from this filename and emit it as a DATE and column name 'FileDate'. Ultimately, I'd like run a filter on files based on their dates.

    ctx_sbb_20140328.csv

    Thank you,


  • 2.  RE: How to retrieve the date from this Filename?

    Employee
    Posted 05-13-2014 07:40

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

    Originally posted by: stonysmith

    You can do this with a bit of code:

    f=FileName.replace(".csv","") #remove csv suffix
    s=f.split("_") # split the name into an array
    d=s[len(s)-1] # get the last element of the array
    emit FileDate = d.date("CCYYMMDD")