Dynamic file path and file name patterns can be used when creating certain types of import and export jobs. If you are importing or exporting data to a file-based connection, you must specify a file type and name. If you set up your import/export job to update automatically on a specified schedule, then the new file overwrites the old one. This can be avoided by using dynamic file path and name patterns.
You can't use dynamic (variable) values, such as column names or data values, generated from workbooks as patterns.
File Path Placeholders
The following variables are replaced by dynamic values during import / export:
Current day of month (01-31)
|%hour%||-||Current hour (00-23)|
Auto increment number *
|%min%||-||Current minute (00-59)|
|%month%||-||Current month (01-12)|
* An auto increment number only works if the import / export job is split into more than one file. The first split is 1 and then continues to the total number of imported / exported files.
is replaced with
when e.g., an import job is executed on Feb. 8th, 2009 by the user John.
Custom File Path Placeholders
You can create custom placeholders if additional variables are required for the file path.
Create custom path placeholder:
- Open the default.properties file.
Add in the custom property and save the file.
system.property.envname.<placeholder name>=<folder name>
Open or restart Datameer
Create or open an import/export job.
- Select a filesystem based connection (Example: SFTP, HDFS, FTP, ...) and file type.
- Enter the file path using
%env:<placeholder name>% as defined in the default.properties file.
- Finish completing the import/export job wizard.
If using Smart Execution:
- Repeat steps 2-8 for the das-common.properties file.
Saving the following to the default.properties folder:
The file path:
is replaced with:
Defining date patterns.
Date or Time Component
Month in year
July; Jul; 07
Week in year
Week in month
Day in year
Day in month
Day of week in month
Day in week
Hour in day (0-23)
Hour in day (1-24)
Hour in am/pm (0-11)
Hour in am/pm (1-12)
Minute in hour
Second in minute
PST; Pacific Standard Time
Time zone offset/id
-0800; -08:00; America/Los_Angeles
Date and Time Pattern
"yyyy.MM.dd G 'at' HH:mm:ss z"
2001.07.04 AD at 12:08:56 PDT
"EEE, MMM d, ''yy"
Wed, Jul 4, '01
"hh 'o''clock' a, zzz"
12 o'clock PM, Pacific Daylight Time
"K:mm a, z"
0:08 PM, PDT
"yyyyy.MMMMM.dd GGG hh:mm aaa"
02001.July.04 AD 12:08 PM
"EEE, d MMM yyyy HH:mm:ss Z"
Wed, 4 Jul 2001 12:08:56 -0700
|yyyy-MM-dd HH:mm:ss.SSSSSS||2012-05-16 11:16:55.532875|
When no patterns are used in file names, existing files are replaced.
Other than writing the direct file path, using default pattern placeholders, building your own placeholders, or using date patterns, Datameer has other tools useful to write file paths.
This can represent any number of characters (including zero, in other words, zero or more characters)
You can also use a wild card to indicate that all files of one type within a specific folder should be used.
|Alternative globbing patterns||Various command-line utilities. View a list located in the GNU/Linux Command-Line Tools Summary documentation.|
|Regular Expressions||A sequence of symbols and characters expressing a string or pattern to be searched for within a longer piece of text.|