Computer Hope

Microsoft => Microsoft DOS => Topic started by: great_compressor_pain on November 05, 2009, 08:20:29 AM

Title: Need Help with renaming thousands of files
Post by: great_compressor_pain on November 05, 2009, 08:20:29 AM
pls help me im Average in Batch Processing...

i have may files to rename
Suppose if my files are in E:\test batch\test1.txt,test2.txt.....
which r of nearly 10mb in size


& i want to replace it with another test1.txt,test2.txt.....
which r of 2kb 's in size

there r nearly hundreds of files

so what should b the command lines?????????
Title: Re: Need Help with renaming thousands of files
Post by: wbrost on November 05, 2009, 08:46:07 AM
What is the process you are using now to compress the files and then replace the originals? There should be a switch to replace the files as they are created.
Title: Re: Need Help with renaming thousands of files
Post by: billrich on November 05, 2009, 10:23:11 AM
Great_Compressor_Pain  wrote:
 
"I have may files to rename.
Suppose if my files are in E:\test batch\test1.txt,test2.txt.....
which are  nearly 10mb in size

I want to replace it with another test1.txt,test2.txt.....
which are nearly  2kb 's in size.

There are nearly hundreds of files."

I wonder how the  "Great_Compressor_Pain"  can go from 10Meg to 2k  without compression?


(https://fineartamerica.com/images-medium/howl-at-the-moon-evelyn-patrick.jpg)
Title: Re: Need Help with renaming thousands of files
Post by: patio on November 05, 2009, 01:29:55 PM
Am i missing the connection here between compressing and renaming files...or is it a Full Moon ? ?
Title: Re: Need Help with renaming thousands of files
Post by: wbrost on November 06, 2009, 06:17:37 AM

I wonder how the  "Great_Compressor_Pain"  can go from 10Meg to 2k  without compression?

he has completed the compression or he would not know the file size with compression. What I think he was/is asking for is how to replace the original files with the compressed versions.

@great_compressor_pain

What compression utility are you utilizing? There should be switches or commands to replace files as they are compressed. We will need to know the program before we can give you the available switches or commands.
Title: Re: Need Help with renaming thousands of files
Post by: billrich on November 06, 2009, 04:30:47 PM

I have may files to rename
Suppose if my files are in E:\test batch\test1.txt,test2.txt.....
which are nearly 10mb in size


& I want to replace it with another test1.txt,test2.txt.....
which are of 2kb 's in size

There are hundreds of files.

So what should b the command lines be?


You may rename as you copy with the following code by Greg:
The destination string must include a counter and the file extention:

Code: [Select]
@echo off
setlocal enabledelayedexpansion


set /a j=0
dir /B  /s  *.mod  >  mod.txt

for /f "delims=" %%a in (mod.txt) do (

set /a j+=1



copy "%%a" E:\tmp\!j!.mod
)

reference:

http://www.computerhope.com/forum/index.php/topic,94198.msg637309.html#msg637309
Title: Re: Need Help with renaming thousands of files
Post by: great_compressor_pain on November 07, 2009, 09:55:49 AM
Means...
If there is a file named test.avi which is in Lower quality of size 10mb
and i just replace it with another test.avi of size 2kb whose quality is 10 times
worse than ever
Title: Re: Need Help with renaming thousands of files
Post by: billrich on November 07, 2009, 07:50:54 PM
Means...
If there is a file named test.avi which is in Lower quality of size 10mb
and i just replace it with another test.avi of size 2kb whose quality is 10 times
worse than ever

Unless you are out of space don't compress.  Put seldom used files on an external drive.

Good Luck.
Title: Re: Need Help with renaming thousands of files
Post by: gh0std0g74 on November 07, 2009, 09:57:12 PM
@OP, describe what you want to do EXACTLY. You can making the people who answer your post more confused... . Do you want to convert avi from high quality to lower quality ? then use a video conversion tool that does that for you. If you are talking about compression as in what zip or winzip does for you, then no, compressing an avi file doesn't give you much reduction in size.
Title: Re: Need Help with renaming thousands of files
Post by: great_compressor_pain on November 08, 2009, 06:59:12 AM
Now this is The real thing

i rip off videos from games...(not really rip off just MOVE them in Temp Folder)

Now my Temp Folder is in

E:\Temp\

It Contain 36 *.bik files (video Files) of game which r 2 b Replaced by 36 blank *.bik files

which Are in:

E:\Temp\Movies
Title: Re: Need Help with renaming thousands of files
Post by: BC_Programmer on November 08, 2009, 02:19:29 PM
Code: [Select]
@echo off
for %%P in (*.bik) do copy /Y E:\temp\movies\%%P .

replaces "bik" files in current folder with files from E:\temp\movies.
Title: Re: Need Help with renaming thousands of files
Post by: great_compressor_pain on November 15, 2009, 07:26:53 AM
I appreciate all  replies
but no one works
Title: Re: Need Help with renaming thousands of files
Post by: billrich on November 15, 2009, 08:21:28 AM
I appreciate all  replies
but no one works

Take your computer to your trusted local computer shop. 

If you need money to pay for the software repair, contact me by email.
Title: Re: Need Help with renaming thousands of files
Post by: Salmon Trout on November 15, 2009, 08:45:54 AM
He's gone mad.
Title: Re: Need Help with renaming thousands of files
Post by: great_compressor_pain on November 23, 2009, 07:22:12 AM
Salmon u r not Understanding ma problem

Last tym I ll try 2 explain wat problem is



consider my game is Batman
and ma videos are in E:\Batman\Videos\Trailer.bik (50 mb)

now i Have the low quality Video of 10 mb in E:\Temp\Temp.bik
(now u understood Problem is not size but the "NAME"

pls Give me a code which would Overwrite Trailer.bik with Temp.bik [and  rename Temp.bik to Trailer.bik]


der r LOLS of Filessssssssssssssssssssssssssss
Title: Re: Need Help with renaming thousands of files
Post by: Salmon Trout on November 23, 2009, 07:36:27 AM
Not explained properly.

Title: Re: Need Help with renaming thousands of files
Post by: gpl on November 23, 2009, 07:39:24 AM
How can you tell that
E:\Temp\Temp.bik
is the small version of
E:\Batman\Videos\Trailer.bik

?
Title: Re: Need Help with renaming thousands of files
Post by: Bukhari1986 on November 23, 2009, 06:28:54 PM
consider my game is Batman
and ma videos are in E:\Batman\Videos\Trailer.bik (50 mb)

now i Have the low quality Video of 10 mb in E:\Temp\Temp.bik
(now u understood Problem is not size but the "NAME"

pls Give me a code which would Overwrite Trailer.bik with Temp.bik [and  rename Temp.bik to Trailer.bik]
============================================




May be my solution works



@echo off

del e:\batman\videos\*.bik     

copy e:\temp\temp*.bik e:\batman\videos\trai*.bik


>>>> first line deletes all *.bik files in videos folder

>>>> second will copy all the files on the name of trai.bik

this i did by supposing that you have given numbers to temp.bik like temp001.bik, temp002.bik, .....

Note 1: this method i have shared is only copying /replacing in the name size of both the sides are equal (like temp001.bik and trai001.bik    the numbers may exceed to thousands but the alphabates should be same)


Note 2: If you do not want to delete the other files, you can copy it somewhere else before deleting by using the command copy e:\batman\vidios\*.bik e:\copy\




Just open a notepad, write the above code, and save in the .bat extension  :)

Please reply if it works


As I only registered for replying to your thread
Title: Re: Need Help with renaming thousands of files
Post by: great_compressor_pain on November 26, 2009, 10:36:39 PM
gpl

ive used bink video compressor to compress my bink videos (.bik)



salmon ur my last hope

pls help
Title: Re: Need Help with renaming thousands of files
Post by: great_compressor_pain on November 27, 2009, 07:20:57 AM
hey salmon ive pasted a new And hardest QUERY in ma lyf in COMPUTER PROGRAMMING section
pls check it out
Title: Re: Need Help with renaming thousands of files
Post by: Bukhari1986 on November 27, 2009, 10:03:35 AM
Mr. PAIN

my solution didn't worked??

I tested it on my computer and then posted it here

It can copy large number of files from one place to another according to what you said.

you should have atleast replied to my post with words "NO Thanks I do not need your Help"  I wasted my such a long time by coming again and again to the forum to see weather you understood my solution or not and you even didn't replied with a single word and you ignored it if there wasn't any post at all.

huh
Title: Re: Need Help with renaming thousands of files
Post by: patio on November 27, 2009, 11:05:33 AM
You may not be suited to a Forum atmosphere...this happens you know...
Title: Re: Need Help with renaming thousands of files
Post by: Salmon Trout on November 27, 2009, 11:19:56 AM
huh

I feel your pain! Seriously, don't, ever, expect any thanks for helping people on forums. It's nice if you get some, sure, but very often people just read your reply and bugger off. Like patio says, this happens (very often).
Title: Re: Need Help with renaming thousands of files
Post by: Bukhari1986 on November 27, 2009, 01:04:54 PM
Thanks a lot Salmon

I will never forget this great words of yours

Thanks again
Title: Re: Need Help with renaming thousands of files
Post by: great_compressor_pain on November 29, 2009, 08:59:25 AM
Hey Salmon ive got sum Part of my Query

my File is "E:\TEST\ESRB.bik"(1 kb)   

other File is "E:\TEST\test\bink.bik"(1 mb)

my Code is

xcopy E:\TEST\ESRB.bik E:\TEST\test\bink.bik

this Overwrites the [1 mb FILE (bink.bik) With ESRB.bik (1 KB) Without changing the names


now if there r 100's of files in E:\TEST\        and in       E:\TEST\test\


wat shld b d CODE
Title: Re: Need Help with renaming thousands of files
Post by: Bukhari1986 on November 29, 2009, 09:32:23 AM
try * or ? for the number of files

eg.

esrb1.bik
esrb2.bik
.
.
esrb100.bik
.
.
esrb1000.bik



then use in the command 

xcopy E:\TEST\ESRB*.bik E:\TEST\test\bink*.bik



? is for known number of digits i.e. if esrb001.bik   then use esrb???.bik  this will not act on esrb10000.bik. whereas esrb*.bik will work


:D



Enjoy
Title: Re: Need Help with renaming thousands of files
Post by: great_compressor_pain on November 30, 2009, 12:12:40 AM
no Bukhari1986 no

ESRB.bik.....that part is OK [u r absolutely right,thanks]

but th problem is bink.bik

ther r several names for eg Trailer.bik
                                            Attractmode.bik
                                            And many more, but none of the names r repeated
Title: Re: Need Help with renaming thousands of files
Post by: Bukhari1986 on November 30, 2009, 06:07:29 AM
if you do not want to change the name of each file while copying to the destination directory then the following command

xcopy E:\TEST\*.bik E:\TEST\test\*.bik      (copying everything with the extension .bik)

OR

xcopy E:\TEST\*.* E:\TEST\test\*.*        (for Everything in the directory.)

you can stop the option of confirming the overwrite question by putting /Y at the end or you can see more help with the xcopy command by typing xcopy /? in a command prompt.


If your requirement is to copy every separate named file to the destination folder with a new name for each of the file, then you need to input a separate command for every file or every set of files with similar names.



:D



Regards

Bukhari1986
Title: Re: Need Help with renaming thousands of files
Post by: Bukhari1986 on December 05, 2009, 08:45:16 AM
@ pain

I found your another post for finding the source code of some Inject.exe software.

I think you search Resource Hacker Software for it and open that exe file through it

may be you get help.
Title: Re: Need Help with renaming thousands of files
Post by: Salmon Trout on December 05, 2009, 09:23:24 AM
@ pain

I found your another post for finding the source code of some Inject.exe software.

I think you search Resource Hacker Software for it and open that exe file through it

may be you get help.


Pain has left the forum.
Title: Re: Need Help with renaming thousands of files
Post by: Bukhari1986 on December 05, 2009, 10:04:21 AM
oh

i am not used to with this forum

Title: Re: Need Help with renaming thousands of files
Post by: Salmon Trout on December 05, 2009, 10:09:14 AM
You can see his name appears in black, and the word "guest" underneath.
Title: Re: Need Help with renaming thousands of files
Post by: patio on December 05, 2009, 10:58:52 AM
Quote
Pain has left the forum.

Line of the Month Award ! !

                     ;)