Copy using Prefix and Suffix

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
AnthonyCian
Senior Member
Senior Member
Posts: 265
Joined: 2005-06-16, 01:45 UTC
Location: Thatcher Az. USA

Copy using Prefix and Suffix

Post by *AnthonyCian »

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
User avatar
SQUIRE
Senior Member
Senior Member
Posts: 373
Joined: 2005-06-16, 18:07 UTC

Post by *SQUIRE »

Just adding your desired prefix or suffix to the *.* ought to do it.
User avatar
Gral
Power Member
Power Member
Posts: 1609
Joined: 2005-01-26, 15:12 UTC

Post by *Gral »

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).
User avatar
white
Power Member
Power Member
Posts: 6013
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Gral wrote:It's easy for suffix on files with fixed length filename.
E.g.
source files

12345.raw
12346.raw

type ?????suffix.*
Also works with variable file name length. Just include enough question marks. (Same as when zipping files to separate archives, see here)

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
User avatar
nsp
Power Member
Power Member
Posts: 1954
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Copy using Prefix and Suffix

Post by *nsp »

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
If you only manipulate plain files (not inside archive).
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"
You have to replace [prefix] and [suffix] by what you want....


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...
siealex
Senior Member
Senior Member
Posts: 316
Joined: 2009-03-22, 16:36 UTC

Post by *siealex »

Copy all desired files into a new folder and use Multi-Rename. It allows to add everything to file names.
We are not so S.M.A.R.T. as we imagine...
User avatar
AnthonyCian
Senior Member
Senior Member
Posts: 265
Joined: 2005-06-16, 01:45 UTC
Location: Thatcher Az. USA

Post by *AnthonyCian »

TO SQUIRE
I wish it was that simple, but it doesn't work like that, I tried it.

TO Gral and White:
Interesting and understand it.

TO nsp:
Like to try it, but not sure what is and where is TCBL.exe?

Thanks all,

AnthonyCian
User avatar
AnthonyCian
Senior Member
Senior Member
Posts: 265
Joined: 2005-06-16, 01:45 UTC
Location: Thatcher Az. USA

Post by *AnthonyCian »

TO siealexL
Yes this is the way I been doing it for a long long time. Was hoping for a 1 step process in the copy window prompt.

Thanks

AC
User avatar
nsp
Power Member
Power Member
Posts: 1954
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

-- Just Try --

Post by *nsp »

AnthonyCian wrote:TO nsp:
Like to try it, but not sure what is and where is TCBL.exe?
TCBL is a external tools that create a batch file and execute it from a file list... Give a look Here
An option in MultiRename that tranform it to MultiCopyOrRenameTool is the best but is not yet available....
User avatar
AnthonyCian
Senior Member
Senior Member
Posts: 265
Joined: 2005-06-16, 01:45 UTC
Location: Thatcher Az. USA

Post by *AnthonyCian »

To nsp:
Thanks, when I get a chance I will look into it. The best solution as you mention, is for the TC MultiRename feature incorporate a file copy/rename option using the parameters set in MultiRename. That would be awesome.
AC
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

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
.
Post Reply