Copy using Prefix and Suffix
Moderators: Hacker, petermad, Stefan2, white
- AnthonyCian
- Senior Member
- Posts: 265
- Joined: 2005-06-16, 01:45 UTC
- Location: Thatcher Az. USA
Copy using Prefix and Suffix
When I want to copy multiple files, the field shows *.* and all the files are copied with the exact same filenames. I like to add a prefix or suffix at times during a copy. If the filenames are 12345.raw; 12346.raw; I like to add a prefix and when copied it would be XXX12345.raw; XXX12346.raw.
Is this possible in TC, or a plugin?
THANKS,
AC
Is this possible in TC, or a plugin?
THANKS,
AC
It's easy for suffix on files with fixed length filename.
E.g.
source files
12345.raw
12346.raw
type ?????suffix.*
result:
12345suffix.raw
12346suffix.raw
You can also add "second extension" by typing:
*.*.suffix
result
12345.raw.suffix
12346.raw.suffix
or new part of extension by typing
*.*suffix
(note: in this case, the file names can have different lengths)
It's probably not possible with prefix (although i'm not absolutely sure).
E.g.
source files
12345.raw
12346.raw
type ?????suffix.*
result:
12345suffix.raw
12346suffix.raw
You can also add "second extension" by typing:
*.*.suffix
result
12345.raw.suffix
12346.raw.suffix
or new part of extension by typing
*.*suffix
(note: in this case, the file names can have different lengths)
It's probably not possible with prefix (although i'm not absolutely sure).
Also works with variable file name length. Just include enough question marks. (Same as when zipping files to separate archives, see here)Gral wrote:It's easy for suffix on files with fixed length filename.
E.g.
source files
12345.raw
12346.raw
type ?????suffix.*
AFAIK adding a prefix is not possible. You can add a (new) sub folder though.
Last edited by white on 2022-03-22, 21:03 UTC, edited 1 time in total.
Reason: fixed link
Reason: fixed link
Re: Copy using Prefix and Suffix
If you only manipulate plain files (not inside archive).AnthonyCian wrote:When I want to copy multiple files, the field shows *.* and all the files are copied with the exact same filenames. I like to add a prefix or suffix at times during a copy. If the filenames are 12345.raw; 12346.raw; I like to add a prefix and when copied it would be XXX12345.raw; XXX12346.raw.
Is this possible in TC, or a plugin?
THANKS,
AC
You can use tcbl in a button or a user command:
Code: Select all
command: %commander_path%\tools\tcbl\TCBL.exe
Parametter: ?-p%L copy "$f" "%T\[prefix]$z[suffix].$e"
If you want to query [prefix] and [Suffix], you can use a TCBL command defined in tcbl.ini and internal variables. I can help if you need...
- AnthonyCian
- Senior Member
- Posts: 265
- Joined: 2005-06-16, 01:45 UTC
- Location: Thatcher Az. USA
- AnthonyCian
- Senior Member
- Posts: 265
- Joined: 2005-06-16, 01:45 UTC
- Location: Thatcher Az. USA
-- Just Try --
TCBL is a external tools that create a batch file and execute it from a file list... Give a look HereAnthonyCian wrote:TO nsp:
Like to try it, but not sure what is and where is TCBL.exe?
An option in MultiRename that tranform it to MultiCopyOrRenameTool is the best but is not yet available....
- AnthonyCian
- Senior Member
- Posts: 265
- Joined: 2005-06-16, 01:45 UTC
- Location: Thatcher Az. USA
I would probably utilize a VBScript.
dummy code:
Button
cmd: my.vbs
para: %S %T
my.vbs
- get given parameter
- prompt for prefix
- prompt for suffix
- ReadAll %temp%\tc.tmp
- For Each line
- - - split path, name and extension
- - - create newName from prefix oldName suffix extension
- - - copy file from old path with newName to Target
--- or
Button
cmd: my.vbs
para: %S %T myprefix mysuffix
my.vbs
- get given parameter
- ReadAll %temp%\tc.tmp
- For Each line
- - - split path, name and extension
- - - create newName from prefix oldName suffix extension
- - - copy file from old path with newName to Target
.
dummy code:
Button
cmd: my.vbs
para: %S %T
my.vbs
- get given parameter
- prompt for prefix
- prompt for suffix
- ReadAll %temp%\tc.tmp
- For Each line
- - - split path, name and extension
- - - create newName from prefix oldName suffix extension
- - - copy file from old path with newName to Target
--- or
Button
cmd: my.vbs
para: %S %T myprefix mysuffix
my.vbs
- get given parameter
- ReadAll %temp%\tc.tmp
- For Each line
- - - split path, name and extension
- - - create newName from prefix oldName suffix extension
- - - copy file from old path with newName to Target
.