Sorry for dumb question.
i have file filename033.avi
i need:
- create file called filename.avi
- create file called filename_33.avi
How to do it?
Sorry for dumb question.
i have file filename033.avi
i need:
How to do it?
Not a dumb question at all. For the first I'd use a regular expression rename, for the second, a find and replace rename. Screen grabs follow:
sorry, my fault
i want done this with command line
ups - i cannot edit my posts...
I want to create button to solve this - i want to select file, click the button and get result
Here's the first:
Rename REGEXP PATTERN ([^0-9]+)[0-9]+(\..*) TO \1\2
And here's the second:
Rename PATTERN "0" TO "_" FINDREP
Thanks for answer.
But i think about button....
filename0XX.avi - filenameASD.avi.
I want to replace third letter from right.
And now last question.
I need this for command:
PROGRAM PARAMETERS "{f}" "NEWNAME"
like in ms-dos this command for this one file...:
PROGRAM PARAMETERS "c:\filenameXCD.avi" "c:\filename_CD.avi"
how to do it?
replace {f} with array? And finally put this in the command?
How i can do it?
Try this:
Rename REGEXP PATTERN "(.*).(..\....)" TO "\1_\2"
I do not understand your last question. Does "c:\filenameXCD.avi" mean a file you have selected in Opus? What exactly are you trying to do?
ia have file called "filenameXCD.avi"
In ms-dos example:
PROGRAM.exe -a -b -c "c:\filenameXCD.avi" "c:\filename_CD.avi"
when in Opus i select file "filenameXCD.avi", i want to execute this program like this, i want get commandline like this...
And remember - "XCD" is only in this line, i want use this button in other situations ("...123.avi", "...a7h.avi")
i want cut three characters (exact replace 3-rd) from filename from right side.
But i no ideas how i cat do this...
So, you want to replace the 3rd character from the right, whatever the filename is?
Filename003.txt
NameABC.doc
12000.txt
And you want to replace the 3rd character with an underscore (low line), whatever the filename is?
Filename_03.txt
Name_BC.doc
12_00.txt
As Christiaan said, it sounds like you want to replace the 3rd from right (not counting .avi) with something like a _ and then use that new name in a button command to send the new name to an external program?
For example say you have filenameXCD.avi selected in Opus.
But when it is all done you want to run a command something like:
PROGRAM.EXE filename_CD.avi
If so, try something like this:
@nodeselect
Rename REGEXP PATTERN "(.*).(..\....)" TO "\1_\2"
"C:\test\external program.exe" {F}
Note you may need to use {f} instead of {F} depending on what your external progam requires.
@LITWINCZUK:
It would help if you gave a brief description of what you are trying to do, like what the program does, etc etc.
@JohnZ and Christiaan:
I think he's not actually trying to rename the original file in Opus at all... I'm just reading this entire thread for the first time, and it seems (to me) after looking at this with a fresh pair of eyes that maybe he wants to select the fileXXX, and pass that filename along with a STRING 'based' on the filename to the external program... perhaps a transcoder or something that will actually be creating a new file using the STRING being passed?
If that is the case, I don't think you can kluge this sort of string manipulation using Opus even with Opus variables... probably have to use an external vbscript or something eh?
sorry for my poor english, i learn it myself...
When i done this work, i public new button - what reencode video with one-click with virtualdub
I have a Nokia E61 phone, with installed SmartMovie. This is a video player. I want to create a command line to reencode avi files.
This button work correctly, but i want do to a little upgrade, but i have no idea how to do it..
PROGRAM FILE_IN FILE_OUT
like
PROGRAM "{f}" "{O|noext}_E61.avi"
i don't remember how use {f} and {o} to create "filenameDGEE"+".avi" extension
example:
{f}="d:\filenameDGEE.avi" - this will result a file created by virtualdub named "d:\filenameDGEE_E61.avi"
but.... how to create
PROGRAM "{f}" ????
to get "d:\filename_E61.avi" or "d:\filename_GEE.avi"
"{O|noext}_E61.avi" should work. If you have problems with Opus automatically adding quotes in the wrong places because of the prefix you're adding, add this line the top of the command:
@nofilenamequoting
That tells Opus not to add quotes automatically, so you only get the quotes which you add to the command yourself (which you have already added in your example).
[s]You can also use {O|ext} to insert the file extension (including the .), which might be useful if the command has to work with more than just .AVI files. For example,
"{O|noext}_E61{O|ext}"[/s]
Edit: After I tried this I realised that {O|ext} inserts a space before the extension, so it isn't useful in this example. The @nofilenamequoting is still worth a try, though.
Edit 2: {o|ext} (lower-case o) is fine, though, and there's a good reason not to use {O|ext} (upper-case o), which I'll explain in a proper reply.
as you see, this question is simple, but to do this is a little problem...
I find solution!
"{f}" {d}{o|noext}"_E61"{o|ext}
selected file:
"F:\TEMP\uTorrent\Pobrane\seriale\The Outer Limits\The Outer Limits - 2x01 - A Stitch In Time.avi"
After use on destination (used {d}) will be created file:
The Outer Limits - 2x01 - A Stitch In Time_E61.avi
"{f}" {o|noext}"_E61"{o|ext}
[quote="LITWINCZUK"]I find solution!
{d}{o|noext}"_E61"{o|ext}[/quote]
That will insert some extra quotes into the name which could cause a problem, although most software will probably ignore them.
...but your idea made me realise that {o|ext} (lowercase o) works fine; it is only {O|ext} which inserts the space. Strange but true!
So you can simply use this to get an exact result (no extra spaces or quotes in the filename):
{O|noext}_E61{o|ext}
In your latest example, you are no longer REPLACING any characters in the 'filename' portion... just ADDING characters to the enf of the existing filenames, along with re-adding the extension.
Again, it seems like what you want to do is best accomplished by a script IF you want to REPLACE characters in the existing filename and send the resulting 'new' name as a string to VirtualDub.
If you're happy with simply ADDING characters to the end of the existing filename, then what 'exactly' is the problem with the latest button you've tried so far?
{d}{O|noext}_E61{o|ext}
result: error
{O|noext}_E61{o|ext}
result: error
{d}{O|noext}"_E61"{o|ext}
result: error
{O|noext}"_E61"{o|ext}
result: error
{o|noext}"_E61"{o|ext}
result: WORKING
Tested with files located on patch:
F:\TEMP\uTorrent\Pobrane\seriale\The Outer Limits
filename:
The Outer Limits - 2x12 - Inconstant Moon.avi
will be created file named: (i show file patch+file) (filename will be created as "The Outer Limits - 2x12 - Inconstant Moon.avi")
"F:\TEMP\uTorrent\Pobrane\seriale\The Outer Limits\The Outer Limits - 2x12 - Inconstant Moon.avi"
(also {o|noext}"_E61"{o|ext} working fine with with destination "F:\TEMP\uTorrent\Pobrane\seriale\The Outer Limits\The Outer Limits Episode Guide")
Big thanks to all for help me found a solution !!
Steje, i know what i adding a part of text - first of my question is still active.
This another problem what i have with this button what i creating now.