Important 3 Letter MTG/MWS Set Codes Overhaul Poll: Vote Now
Discuss anything concerning this site and its contents
Moderator: CCGHQ Admins
Re: Important 3 Letter MTG/MWS Set Codes Overhaul Poll: Vote
by ParkerLewis » 01 Nov 2016, 10:52
Great.
The two following solutions require a list of all set names to change in a set_names.txt file with the following format :
Old name/New name
To auto-rename directories
Just create a .txt file, open it with Notepad, and input this :
Save and rename it as "folder_rename.bat". Then just run it *as an administrator* (you may need to right-click => run as admin). Work done, all your set directories are correctly renamed.
To auto-update .mwDeck files
There is no real way to mess this up either, but just in case, please make a copy of your Decks folder somewhere.
To batch replace set codes inside .mwDeck files, https://findandreplace.codeplex.com/ will help us do the job. Just get the program first and put it anywhere you like (it's a simple fnr.exe, no install, no nothing). You can open it if you want but that's not going to be needed.
Now that you have your fnr.exe, create a .txt file, open it with Notepad, and input this :
Save and rename it as "deck_update.bat". Then just run it by double-clicking on it (you might need to right-click => run as admin). Work done, all your .mwDeck files are updated.
Both at the same time
Of course, you can also just make one .bat file to do both :
The two following solutions require a list of all set names to change in a set_names.txt file with the following format :
Old name/New name
- Code: Select all
A/LEA
B/LEB
U/2ED
AN/ARN
AQ/ATQ
R/3ED
LG/LEG
DK/DRK
FE/FEM
4E/4ED
IA/ICE
CH/CHR
HM/HML
AL/ALL
MI/MIR
VI/VIS
5E/5ED
PT/POR
WL/WTH
TE/TMP
SH/STH
EX/EXO
P2/P02
UG/UGL
US/USG
AT/ATH
UL/ULG
6E/6ED
UD/UDS
P3/PTK
ST/S99
MM/MMQ
NE/NEM
PR/PCY
IN/INV
PS/PLS
7E/7ED
AP/APC
OD/ODY
TO/TOR
JU/JUD
ON/ONS
LE/LGN
SC/SCG
8E/8ED
9E/9ED
MR/MRD
DS/DST
FD/5DN
CS/CSP
GP/GPT
To auto-rename directories
Just create a .txt file, open it with Notepad, and input this :
- Code: Select all
set picsdir=D:\Example\Magic Workstation\Pics
set txtsource=D:\Example\Magic Workstation\set_names.txt
for /f "usebackq tokens=1,2 delims=/" %%i in ("%txtsource%") do if exist "%picsdir%\%%i" (move "%picsdir%\%%i" "%picsdir%\%%j")
Save and rename it as "folder_rename.bat". Then just run it *as an administrator* (you may need to right-click => run as admin). Work done, all your set directories are correctly renamed.
To auto-update .mwDeck files
There is no real way to mess this up either, but just in case, please make a copy of your Decks folder somewhere.
To batch replace set codes inside .mwDeck files, https://findandreplace.codeplex.com/ will help us do the job. Just get the program first and put it anywhere you like (it's a simple fnr.exe, no install, no nothing). You can open it if you want but that's not going to be needed.
Now that you have your fnr.exe, create a .txt file, open it with Notepad, and input this :
- Code: Select all
set fnrexe=C:\FNR\fnr.exe
set decksdir=D:\Magic Workstation\Decks
set txtsource=D:\Example\Magic Workstation\set_names.txt
for /f "usebackq tokens=1,2 delims=/" %%i in ("%txtsource%") do ("%fnrexe%" --cl --dir "%decksdir%" --fileMask "*.mwDeck" --includeSubDirectories --find "[%%i]" --replace "[%%j]")
Save and rename it as "deck_update.bat". Then just run it by double-clicking on it (you might need to right-click => run as admin). Work done, all your .mwDeck files are updated.
Both at the same time
Of course, you can also just make one .bat file to do both :
- Code: Select all
@REM This code can be run from anywhere. Requirements :
@REM 1) Have a list of all set names to change in a set_names.txt file.
@REM This set_names.txt file should have 1 line per set name. The expected syntax for these lines is this : oldname/newname
@REM 2) Have fnr.exe somewhere on your computer (downloadable from findandreplace.codeplex.com). This is a simple .exe, no install required.
@REM 3) You have to edit fields below to input the location of a) your MWS Pics directory, b) your fnr.exe, and c) your MWS Decks directory.
@REM Once this is done, just save & close the file (make sure it is still a .bat), then run it by double-clicking on it or via a command window. That's it :)
@REM Update pictures set folders names with new name convention
set picsdir=D:\Example\Magic Workstation\Pics
set txtsource=D:\Example\Magic Workstation\set_names.txt
for /f "usebackq tokens=1,2 delims=/" %%i in (%txtsource%) do if exist "%picsdir%\%%i" (move "%picsdir%\%%i" "%picsdir%\%%j")
@REM Update deck files with new name convention
set fnrexe=C:\FNR\fnr.exe
set decksdir=D:\Magic Workstation\Decks
set txtsource=D:\Example\Magic Workstation\set_names.txt
for /f "usebackq tokens=1,2 delims=/" %%i in (%txtsource%) do ("%fnrexe%" --cl --dir "%decksdir%" --fileMask "*.mwDeck" --includeSubDirectories --find "[%%i]" --replace "[%%j]")
Last edited by ParkerLewis on 11 May 2020, 09:03, edited 3 times in total.
- ParkerLewis
- Posts: 17
- Joined: 30 Oct 2016, 22:28
- Has thanked: 0 time
- Been thanked: 0 time
Re: Important 3 Letter MTG/MWS Set Codes Overhaul Poll: Vote
by Davidfrye » 02 Oct 2017, 07:11
Thanks for your work on this Nyth!
- Davidfrye
- Posts: 1
- Joined: 02 Oct 2017, 07:09
- Has thanked: 0 time
- Been thanked: 0 time
32 posts
• Page 3 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 24 guests