It is currently 16 Apr 2024, 21:29
   
Text Size

Important 3 Letter MTG/MWS Set Codes Overhaul Poll: Vote Now

Discuss anything concerning this site and its contents

Moderator: CCGHQ Admins

Do You Support a Change to 3 Letter Set Codes?

Yes
54
96%
No
2
4%
 
Total votes : 56

Re: Important 3 Letter MTG/MWS Set Codes Overhaul Poll: Vote

Postby 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
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
(This is my current set_names.txt test file ; it worked great, and it should be complete).

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")
OF COURSE, you have to edit the relevant path to your MWS Pics dir according to your MWS setup, the path here is just an example.

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]")
OF COURSE, you have to edit the two relevant paths to fnr.exe and your MWS Decks dir according to your setup, the two paths here are just an example.

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

Postby 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

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 19 guests


Who is online

In total there are 19 users online :: 0 registered, 0 hidden and 19 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 19 guests

Login Form