Copying different names to 1 file?

Post any Bulk Rename Command support requirements here. Open to all registered users.

Copying different names to 1 file?

Postby Zakizdaman » Fri Jan 03, 2014 9:13 am

I don't want to do this the long way, so I figured this program might be able to help me.

I have a bunch of sound files, that i want to change what file they are, but maintain the name.

So for this, I have the audio clip

Grunt.Perfect.wav 2 seconds

And i have a bunch of other audio files,

Ezreal.Attack1.wav 1 second
Ezreal.Attack2.wav 1 second
Draven.Taunt1.wav 3 seconds

There are over 1000 of these files, all different.

What I'm trying to do is make every single of those 1000 files have the same sound as Grunt.Perfect.wav, however retaining the name.

Any help?

Edit: oh, and if it makes it easier I can just copy 1000 of Grunt.Perfect.wav and just transfer them over, if there's any way to do that
Zakizdaman
 
Posts: 2
Joined: Fri Jan 03, 2014 9:09 am

rename copies of the same file to many different names

Postby Stefan » Fri Jan 03, 2014 2:01 pm

Hi Zakizdaman


As far as i understood you want to rename copies of the same file to many different names?

If yes, I would try it this way:



1.) make 1000 copies of the file "Grunt.Perfect.wav":
Grunt.Perfect_0001.wav
Grunt.Perfect_0002.wav
...
Grunt.Perfect_1000.wav


2.) make a list from all that file names to a text file:
Grunt.Perfect_0001.wav
Grunt.Perfect_0002.wav
...
Grunt.Perfect_1000.wav


3.) make a list of all the wanted file names to a text file:
Ezreal.Attack1.wav
Ezreal.Attack2.wav
Draven.Taunt1.wav
...


4.) paste them together in another text file:
Grunt.Perfect_0001.wav|Ezreal.Attack1.wav
Grunt.Perfect_0002.wav|Ezreal.Attack2.wav
...
Grunt.Perfect_1000.wav|Draven.Taunt1.wav


5.) Utilize from BRU "Renaming From A Text File"


- - -

How-to:

1) make 1000 copies:

Utilize CopyToMany.cmd
Code: Select all
@ECHO OFF
CD %~dp0

SET base=Grunt.Perfect
SET exte=wav

ECHO copy one file to many; StS 2012
ECHO working, please wait...

setLocal EnableDelayedExpansion

for /L %%D in (1,1,1000) DO (
    SET digit=0000%%D
      SET digit=!digit:~-4!
          copy  %base%.%exte% %base%_!digit!.%exte% >NUL
  )

ECHO. & ECHO All done! & PAUSE



Or with PowerShell:
for($index=1; $index -lt 1001; $index++){       $CopyPattern = "Grunt.Perfect_{0:D4}.wav" -f $index;     copy Grunt.Perfect.wav $CopyPattern;       }



2 + 3) make a list of file names:
- go into the folder
- open a DOS-Box (command line interpreter)
- be sure to have your current working dir in that folder
- utilize: DIR /B >filelist_1_origin.txt
- utilize: DIR /B >filelist_2_wanted.txt


4) paste that two lists together:
    See at 5) for how to utilize Excel,
    or utilize e.g. PowerShell like in this example:

PS C:\temp\BatchTEST> $origin = Get-Content filelist_1_origin.txt
PS C:\temp\BatchTEST> $wanted = Get-Content filelist_2_wanted.txt
PS C:\temp\BatchTEST> $len=$origin.length
PS C:\temp\BatchTEST> $out = for( $idx=0; $idx -lt $len; $idx++) { "{0}|{1}" -f $orign[$idx], $wanted[$idx] }
PS C:\temp\BatchTEST> $out | out-file .\merged.txt
Now use merged.txt for BRUs "Renaming From A Text File"


5) utilize "Renaming From A Text File"
see http://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=2&t=1526&p=4120


HTH?

- - -
Edit: added PowerShell example to create 1000 copies of a source file.
Last edited by Stefan on Sat Jan 04, 2014 1:20 pm, edited 1 time in total.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Copying different names to 1 file?

Postby Zakizdaman » Fri Jan 03, 2014 10:53 pm

Sweet I'll make sure to try this!

Getting all the file names into a text file will probably be a little tedious but easier than the other solution
Zakizdaman
 
Posts: 2
Joined: Fri Jan 03, 2014 9:09 am

BRC wont overwrite file-content

Postby truth » Sat Jan 04, 2014 1:57 am

Are filenames within 1 Dir (same extension)? If so the below suffices:
It matches all .wav's, & then copies Grunt.Perfect's file-contents into them one-by-one.

Forfiles /m *.wav /c "cmd.exe /c copy /y Grunt.Perfect.wav @file"

It will NOT rename anything, but all .wav's will now have GruntPertfect's file-content!
If their original file-content might be needed in the future?? - Copy them first!

Post back with details if you need to handle things like: spaces within Grunt.Perfect,
multiple-filetypes, SubDirs, or perhaps varying GruntPerfect.ext's per each filetype.

Note however, these solutions wont involve BRC, since it mostly affects filenames, not content.
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay


Return to BRC Support