Splitting CHR files from a giant CHR file for use in project

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Splitting CHR files from a giant CHR file for use in project
by on (#115706)
Besides the file splitters that are already there, I want to keep the CHR extentions intact, So I need a new file splitter.

Instead of ''GAMENAME.(number)'' ,etc. I want to know how to split it like ''GAMENAME_(number).CHR''

If it is not that hard to make that happen, is anyone is up to doing it?
Re: Splitting CHR files from a giant CHR file for use in pro
by on (#115711)
Can't you just make a batch file to rename the files to the format you want? A quick online search suggests that this might work:

Code:
for %%f in (GAMENAME.*) do call:renamer %%f
goto:done

:renamer
set filename=%1
ren %1 %filename:.=_%.CHR

:done

Put this in a batch file in the same folder as the split files and double click it. You could even make GAMENAME a parameter instead of hardcoding it in the file, so that you can automate the process.
Re: Splitting CHR files from a giant CHR file for use in pro
by on (#115730)
Thanks, Just what I needed!

I also think it's a bit of an oversight on my part, I did not look enough, So I'll do better to search next time!