# File Name Tokens

You can use file name tokens to name transferred files or to match files that you want to transfer, on either a responder (server) or an initiator (client).

A string of tokens are characters that contain a mixture of literal and substitution values. You can use file name tokens to format file names based on date, time, user information and so on. Therefore, instead of entering a standard file name, you can enter a name that consists of tokens to save time.

There is one special token: *.

- If you perform a cfsend and include a * on the remote file name, the cfsend command will substitute the local file name for the *.
- If you perform a cfrecv and include a * on the local file name, the cfrecv command will substitute the remote file name for the *.

The format of the file name using the token is `$(tokenname)`. All tokens are converted before being sent to the remote system, except for RemoteTransactionNumber.
Note: When you use the dollar sign ($) or the forward slash sign (/) on the command line, some UNIX systems might require a backslash (\) before these signs. Optionally, you can put single quotes around the entire parameter that contains the token. Tokens are case sensitive. A list of file name tokens can be displayed by the cfsend or cfrecv commands by entering the following commands:

`cfsend /htoken`

`cfrecv /htoken`

The following table shows the file name tokens that are supported:

Token | Description | Generated Value
--- | --- | ---
JDate | Julian date | YYYYDDD
Time | Local time | HHMMSSMSS
Time1 | Local time | HHMMSS
Time2 | Local time | HHMMSST
Date | Local date | YYYYMMDD
Date1 | Local date | YYMMDD
Date2 | Local date | MMDDYY
Date3 | Local date | DDMMYY
DateUS | Local date | MMDDYYYY
LocalFileBase | The base name of the local file. | For example: Local file: /home/usr/temp/files/testfile1.txt Remote file: c:\target\$(LocalFileBase) The resolution to this token is testfile1.
LocalFileExt | The extension of the local file. | For example: Local file: /home/usr/temp/files/testfile1.txt Remote file: c:\target\$(LocalFileExt) The resolution to this token is txt.
LocalFileName | The local file name including the extension. | For example: Local file: /home/usr/temp/files/testfile1.txt Remote file: c:\target\$(LocalFileName) The resolution to this token is testfile1.txt. Note: You must use the full path of the remote file, otherwise, the file might be transferred to the $CFROOT directory.
LocalFL## | The file qualifier computed from left-justified position specified by ##. Note: The range of ## is within 1 to 16. | For example: Local file: /home/usr/temp/files/testabc.aaa.bb.c.txt Remote file: c:\target\$(LocalFL01) The resolution to this token is testabc.
LocalFR## | The file qualifier computed from right-justified position specified by ##. Note: The range of ## is within 1 to 16. | For example: Local file: /home/usr/temp/files/testabc.aaa.bb.c.txt Remote file: c:\target\$(LocalFR01) The resolution to this token is txt.
NoLocalFileBase | The local file name excluding the base name. | For example: Local file: /home/usr/temp/files/a.b.c.txt Remote file: c:\target\$(NoLocalFileBase) The resolution to this token is b.c.txt.
NoLocalFileExt | The local file name excluding the extension. | For example: Local file: /home/usr/temp/files/a.b.c.txt Remote file: c:\target\$(NoLocalFileExt) The resolution to this token is a.b.c.
LocalUserId | The local user ID being used for the file transfer. | For example: Local user ID: TESTLAB\cfuser1 Local file: /home/usr/temp/files/testfile1.txt Remote file: c:\target\file1$(LocalUserId).txt The resolution to this token is d:\target\file1cfuser1.txt.
TransactionNumber | Local transaction number | For example: Local file: /home/usr/temp/files/testfile1.txt Remote file: c:\target\$(TransactionNumber).testfile1.txt The resolution to this token is IA18100117.testfile1.
RemoteUserId | Remote user ID used in the file transfer. | For example: Remote user ID: TEST\cfuser1 Local file: /home/usr/files/file1.$(RemoteUserId).txt Remote file: c:\source\directory\testfile1.txt The resolution to this token is /home/usr/files/file1.cfuser1.txt.
RemoteTransactionNumber | Remote transaction number. | For example: Local file: /home/usr/temp/files/testfile1.txt Remote file: c:\target\$(RemoteTransactionNumber).testfile1.txt The resolution to this token is RA18100052.testfile1.
Note: The following tokens can be only used in receive transfers.
RemoteFileBase | The base name of the remote file. | For example: Local file: /home/usr/temp/$(RemoteFileBase) Remote file: c:\source\directory\testfile1.txt The resolution to this token is testfile1.
RemoteFileExt | The extension of the remote file. | For example: Local file: /home/usr/files/$(RemoteFileExt) Remote file: c:\source\directory\testfile1.txt The resolution to this token is txt.
RemoteFileName | The remote file name including the extension. | For example: Local file: /home/usr/files/$(RemoteFileName) Remote file: c:\source\directory\testfile1.txt The resolution to this token is testfile1.txt. Note: You must use the full path of the remote file, otherwise, the file might be transferred to the $CFROOT directory.
RemoteFL## | The file qualifier computed from left-justified position specified by ##. Note: The range of ## is within 1 to 16. | For example: Local file: /home/usr/files/$(RemoteFL01) Remote file: c:\source\directory\ testabc.aaa.bb.c.txt The resolution to this token is testabc.
RemoteFR## | The file qualifier computed from right-justified position specified by ##. Note: The range of ## is within 1 to 16. | For example: Local file: /home/usr/files/$(RemoteFR01) Remote file: c:\source\directory\testabc.aaa.bb.c.txt The resolution to this token is txt.
NoRemoteFileBase | The remote file name excluding the base name. | For example: Local file: /home/usr/temp/files$(NoRemoteFileBase) Remote file: c:\source\directory\a.b.c.txt The resolution to this token is b.c.txt.
NoRemoteFileExt | The remote file name excluding the extension. | For example: Local file: /home/usr/temp/files$(NoRemoteFileBase) Remote file: c:\source\directory\a.b.c.txt The resolution to this token is a.b.c.
UserData | The user data defined by the cfsend or cfrecv commands. | For example: cfsend .... ud:AcctFile The resolution to this token is AcctFile.
$(SYYYY) | The year to be specified using 4 digits. The valid values are from 0000 to 9999. | For example: 2018
$(SYY) | The year to be specified using the last two digits of the year. The valid values are from 00 to 99. | For example: 18 for the year 2018
$(SMON) | The month of the year to be specified using the first three letters and upper case. | For example: JAN for the month of JANUARY
$(SMon) | The month of the year to be specified using the first three letters and lower case. | For example: Jan for the month of January
$(SMM) | The month of the year to be specified as a number. The valid values are from 01 to 12. | For example: 02 for the month of February
$(SDD) | The date or day of the month to be specified. The valid values are from 01 to 31. | For example: 05 for the fifth day of the month
$(SJ) | The Julian day(ddd). | For example: 320

Copyright © 2022. TIBCO Software Inc. All Rights Reserved.