Hi!
I'm not sure if this is the right forum, since it does not have to do with programming directly...
My problem is: For some short avi-videos I need reverse motion. To do this I'm using avi2bmp, which creates a bunch of BMPs, like:
pic01,pic02,pic03,pic04, etc to pic10
To make the animation play backwards I have to rename the files so
pic10 becomes pic01, pic09 becomes pic02, pic 08 becomes pic03 etc...
Then i just need to BMP2AVI and I get an AVI which plays reversely.
My question is: Can I do this in an easier way? I've been thinking about a DOS-Batch file or a Linux Shell-Script where you just change the name of the 1st and the last file and the script does the rest.
But unfortunatelly thats all beyond my knowledge
Can anyone help please?
Easy file renaming?
-
- QuakeDev Respected
- Posts: 592
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Thu Mar 14, 2002 1:15 am
- Has thanked: 0
- Been thanked: 6 times
Easy file renaming?
Create your own Dreamcast games using the Quake-Engine:
http://quakedev.dcemulation.org/develop/getstarted.htm
http://quakedev.dcemulation.org/develop/getstarted.htm
-
- Damn Dirty Ape
- Posts: 5031
- Joined: Thu Nov 07, 2002 11:11 pm
- Location: Saugerties, NY
- Has thanked: 0
- Been thanked: 0
I'm not sure how to do that with a batch file, but it shouldn't be too hard to write a small program to do that. How many bitmap files are we talking about here? I'm reasonably confident that one could write a program that fills an array with the filenames of all of the bitmaps and counts how many there are. Then, it's a simple matter of copying the bitmap to another directory (to avoid overwriting the others) and rename the first one with the name of the last one, and then the name of the second one with the name of the second-to-last file, etc... moving them to a subdirectory as they are renamed so that the last file doesn't get overwritten by the first file, etc.
*edit* I just thought of a way to do it better, actually - give me a few minutes and I'll see what I can do.
*edit* I just thought of a way to do it better, actually - give me a few minutes and I'll see what I can do.
-
- Damn Dirty Ape
- Posts: 5031
- Joined: Thu Nov 07, 2002 11:11 pm
- Location: Saugerties, NY
- Has thanked: 0
- Been thanked: 0
I believe I've got a working command-line program for you. I just want to clean it up a bit and test it a bit more. Basically, here's what it does:
You tell it the name of the folder that has all of your bitmaps.
It goes through and counts the number of bitmap files.
It goes through again, and figures out what the name of each file should and, appends "*.138" to this name, and writes this name to a text file.
It then reads in the text file one line at a time, and renames (for example) pic01.bmp to pic60.bmp.138. (or, it will be pic500.bmp.138 if there are 500 bitmaps.) The .138 is just so that it doesn't overwrite one picture with another.
Finally, it goes and removes the .138 from all the filenames.
Now, I just have to remove some code that I was using to figure out why it didn't work at first, get it to delete the text file, and double-check that it works. After that, I'll figure out how I'm going to get it to you.
You tell it the name of the folder that has all of your bitmaps.
It goes through and counts the number of bitmap files.
It goes through again, and figures out what the name of each file should and, appends "*.138" to this name, and writes this name to a text file.
It then reads in the text file one line at a time, and renames (for example) pic01.bmp to pic60.bmp.138. (or, it will be pic500.bmp.138 if there are 500 bitmaps.) The .138 is just so that it doesn't overwrite one picture with another.
Finally, it goes and removes the .138 from all the filenames.
Now, I just have to remove some code that I was using to figure out why it didn't work at first, get it to delete the text file, and double-check that it works. After that, I'll figure out how I'm going to get it to you.
-
- Damn Dirty Ape
- Posts: 5031
- Joined: Thu Nov 07, 2002 11:11 pm
- Location: Saugerties, NY
- Has thanked: 0
- Been thanked: 0
mojn Moin,
[hi Moin,]
you can use the Total Commander for that.
it's for win systems.
download:
http://www.ghisler.com/index.htm
??how to??
run TC
go to files
highlight the files (pressed right mouse)
menu: Dateien->Mehrfach-Umbenenn-Tool
settings:
Umbenennmaske Dateiname:
[N1-3][C]
Erweiterung:
[E]
Definiere Z?hler[C]:
Starten bei: 10
Schrittweite: -1
Anzahl Stellen: 2
---------------------------------------------
press Start! to run.....
name:
[N1-3]= name letters 1 till 3 (e.g.:pic..1-2 would be pi)
have sceenshot, but dunno how to upload
hope it works
kind regards oli_lo
[hi Moin,]
you can use the Total Commander for that.
it's for win systems.
download:
http://www.ghisler.com/index.htm
??how to??
run TC
go to files
highlight the files (pressed right mouse)
menu: Dateien->Mehrfach-Umbenenn-Tool
settings:
Umbenennmaske Dateiname:
[N1-3][C]
Erweiterung:
[E]
Definiere Z?hler[C]:
Starten bei: 10
Schrittweite: -1
Anzahl Stellen: 2
---------------------------------------------
press Start! to run.....
name:
[N1-3]= name letters 1 till 3 (e.g.:pic..1-2 would be pi)
have sceenshot, but dunno how to upload
hope it works
kind regards oli_lo
-
- QuakeDev Respected
- Posts: 592
- Joined: Thu Mar 14, 2002 1:15 am
- Has thanked: 0
- Been thanked: 6 times
Big thanks for your help 138, I've sent you a pm.
Glad to see you here lo
I'm going to download the commander and try it as well. Thanks for the help.
Hope we'll meet on icq someday again
Glad to see you here lo
I'm going to download the commander and try it as well. Thanks for the help.
Hope we'll meet on icq someday again
Create your own Dreamcast games using the Quake-Engine:
http://quakedev.dcemulation.org/develop/getstarted.htm
http://quakedev.dcemulation.org/develop/getstarted.htm