Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
batch to copy even numbered files
Name: Diddles Date: September 6, 2004 at 12:35:37 Pacific OS: XP CPU/Ram: Athlon/256
Comment:
I'm really hoping sombody can help me with this - I'm a lingo programmer and don't know a lot about DOS, so if you know the answer to this one, you'll have to baby me along. I have a folder with a lot of jpeg images (e.g. j001, j002 etc.) and need to copy every file with an odd numbered name to another folder/or copy the first and every alternate file following it.
I'm really desperate, so any help would be greatly appreciated.
Name: wizard-fred Date: September 6, 2004 at 23:18:58 Pacific
Reply:
I would write a small program to analyze the last character of the filename (excluding extension) and create either a batch file or use a system function to move the file.
Copying the first and every alternate file assumes the directory is sorted or accessed in a sorted manner.
As a matter of interest, how many files?
0
Response Number 2
Name: Diddles Date: September 7, 2004 at 01:27:12 Pacific
Reply:
There's about 6 thousand - all named sequentially.
thanks for getting back to me
0
Response Number 3
Name: IVO Date: September 7, 2004 at 03:00:49 Pacific
Reply:
If files are named sequentially the following script should work for you, but be aware it is far then perfect and I submit that only to stop your pain.
By the way better you post in the Programming Forum next time.
Named the batch JCopy.bat, type JCopy From_Folder To_Folder (Folder's namrs must not have embedded blanks)
@Echo Off
Set Flag=1 For %%A in (%~f1\*.*) Do Call :COPY %%A %~f2 Set Flag= GoTo :EOF
:COPY If %Flag%==1 ( Copy "%1" "%2" & Set Flag=0 ) else ( Set Flag=1) GoTo :EOF
0
Response Number 4
Name: Diddles Date: September 7, 2004 at 15:22:01 Pacific
Summary: I am looking to make a batch to copy all files that are 2 days old. Xcopy will copy using dates. How can I tell a batch file to look for dates of today -2 days? Any ideas? In other words today is 4/28...
Summary: how can i use a script to copy the newest file in a directory? i.e. I have a number of files with similar names (SCAN1,SCAN2,etc) the highest index is the newest file and there can be a maximum of 150...
Summary: Hi, I want to create a bat file to copy my temporary internet files into another directory but even when I use the dos filename (tempor~1) it says that there are no files in the foder to be copied (im...