---
schema_version: "1"
id: 76287718e90b8f1c6536feb357194b58e2e06c0b540f6a597a3e87237006ec62
title: Extracting a Date From the File Name
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/mktg/264-0-0/dato_data_mapping_extracting_date_filename.md
canonical_url: https://help.salesforce.com/s/articleView?id=mktg.dato_data_mapping_extracting_date_filename.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b94f80fe6e242b380ab6e081369777d93b302a73221d07b373b5cab5f2c7a311
description: If your file includes a date in the file name but not in the file itself, you can extract the date field from the file name and use it as the date field.
products:
  - Marketing
  - Marketing Cloud Intelligence
release: "264"
---
# Extracting a Date From the File Name

If your file includes a date in the file name but not in the file itself, you can extract the date field from the file name and use it as the date field.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d102285e38">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d102285e38 ">To extract a date from a file name:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d102285e38 ">Admin</td>

          </tr>
        </tbody>
      </table>

1. From the **Connect & Mix** tab, select **Data Streams**, and then **Data Streams List**
2. Click **Create New**, and upload your file.
3. In the **Map to Model** window click **Date** to add a date field.
4. Click the formula editor icon across from the date field and apply a formula.
    
    Here are some examples of formulas you can use to extract a date from the file name.
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><tbody><tr class=""><td class="slds-cell-wrap"><kbd>PARSEDATE(RIGHT(env['filename'],10),'MM-dd-yyyy').</kbd></td><td class="slds-cell-wrap">The <kbd>RIGHT</kbd> function takes the indicated number of characters starting on the right of the text referenced.</td></tr><tr class=""><td class="slds-cell-wrap"><kbd>PARSEDATE(EXTRACT(env['filename'],'_',1),'MM-dd-yyyy').</kbd></td><td class="slds-cell-wrap">The <kbd>EXTRACT</kbd> function obtains a substring from the string you referenced, according to a delimiter and position. The delimiter is the separator between the parts of the string, and the positions are the different parts sectioned by the delimiter.</td></tr><tr class=""><td class="slds-cell-wrap"><kbd>PARSEDATE(SELECT(env['filename'],'\\d{2}-\\d{2}-\\d{4}'),'MM-dd-yyyy')</kbd></td><td class="slds-cell-wrap">The <kbd>SELECT</kbd> function obtains a specific sub string from the string you referred to based on specific characters or patterns. The function supports the use of multiple regular expressions. In this example, a regular expression is used and this pattern is retrieved: ##-##-####—2 digits, hyphen(-), 2 digits, hyphen, 4 digits. The 'd' in the syntax refers to digits, and the number in the brackets {} indicates the number of digits. The delimiter is stated according to its location in the pattern. You can use the select function syntax and change the delimiter and the number of digits in every position in the pattern according to your data. Only use the select formula if you’re familiar with the use of regular expressions.</td></tr></tbody></table>