It is currently 16 Apr 2024, 15:33
   
Text Size

HQ Card Gen database update utility

by Nate and Snacko

Moderators: Snacko, CCGHQ Admins

HQ Card Gen database update utility

Postby JimMcKeeth » 04 Apr 2012, 20:27

I wanted to generate some proxies from the Dark Ascension series. While the latest patch adds the symbols, it didn't update the cards.csv file with the new cards. At first I just added in manually the cards that I needed. Then I started to think that it would be easier to just do a batch conversion from the csv file provided by the Gatherer Downloader. The result is I made a little utility that can convert from one CSV to the other. I compared it to the new cards.csv that comes with ProxyGen and it was pretty close. Some of the differences were actually errors in the cards.csv file.

I've added the ability to specify the input and output files and externalized some of the configuration files. A lot more that could be done with this. I am including the source code (written in C#) as well as the binary. It isn't optimized, and pretty much just a brute force conversion, but the results are very fast.

See the readme.txt for more information.

Converts the CSV file output from GathererDownloader to the format of the cards.csv used by HQ Proxy Card Generator. Appends to the cards.csv output file if it exists.

Usage: GatherToHQCG.exe [gather.csv] [cards.csv]
Where
    [gather.csv] is the CSV formatted database from the GathererDownloader
    [cards.csv] is the CSV datafile created by the HQ Proxy CardGen

Use the GathererDownloader to only download the specific sets you want to add to your cards.csv. Alternatively you can recreate the entire cards.csv by renaming it first.

There are two support files that contain all the information necessary to support through Dark Ascension.
Attachments
GatherToHQCG.zip
GatherToHQCG v0.1 - Initial release
(16.05 KiB) Downloaded 955 times
Last edited by JimMcKeeth on 15 Apr 2012, 08:56, edited 4 times in total.
JimMcKeeth
 
Posts: 9
Joined: 30 Apr 2011, 00:20
Has thanked: 7 times
Been thanked: 2 times

Re: HQ Card Gen database update utility

Postby Huggybaby » 07 Apr 2012, 09:54

We love helpful utilities here, please post it!
User avatar
Huggybaby
Administrator
 
Posts: 3205
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 696 times
Been thanked: 594 times

Re: HQ Card Gen database update utility

Postby odino182 » 10 Apr 2012, 14:47

can you post it pls? i really need it :)
odino182
 
Posts: 42
Joined: 25 Jun 2008, 13:11
Has thanked: 3 times
Been thanked: 1 time

Re: HQ Card Gen database update utility

Postby JimMcKeeth » 12 Apr 2012, 02:03

I am cleaning it up and making it slightly configurable so it is useful for people besides myself. Will post it soon.
JimMcKeeth
 
Posts: 9
Joined: 30 Apr 2011, 00:20
Has thanked: 7 times
Been thanked: 2 times

Re: HQ Card Gen database update utility

Postby JimMcKeeth » 15 Apr 2012, 08:44

I've uploaded to the top message in this thread. Source is included. Feedback welcome. Currently it works for me, but not tested beyond that.
JimMcKeeth
 
Posts: 9
Joined: 30 Apr 2011, 00:20
Has thanked: 7 times
Been thanked: 2 times

Re: HQ Card Gen database update utility

Postby odino182 » 15 Apr 2012, 13:20

ty alot, can you modify it for other language? example it don't work if i use it with a csv created with gahterer donwload and selected italian. only parse printed oracle text.
odino182
 
Posts: 42
Joined: 25 Jun 2008, 13:11
Has thanked: 3 times
Been thanked: 1 time

Re: HQ Card Gen database update utility

Postby JimMcKeeth » 15 Apr 2012, 17:01

odino182 wrote:ty alot, can you modify it for other language? example it don't work if i use it with a csv created with gahterer donwload and selected italian. only parse printed oracle text.
I am traveling for the next week, but I'll take a look at it when I get back. Should be fairly simple. What happens when you try to use it with the Italian CSV?
JimMcKeeth
 
Posts: 9
Joined: 30 Apr 2011, 00:20
Has thanked: 7 times
Been thanked: 2 times

Re: HQ Card Gen database update utility

Postby odino182 » 15 Apr 2012, 18:45

it get the first information english oracle print text, because the italian information come after
odino182
 
Posts: 42
Joined: 25 Jun 2008, 13:11
Has thanked: 3 times
Been thanked: 1 time

Re: HQ Card Gen database update utility

Postby JimMcKeeth » 26 Apr 2012, 19:22

odino182 wrote:it get the first information english oracle print text, because the italian information come after
I didn't forget about you. Worked on it quite a bit, but having some issues with making it work. I'll get it eventually.
JimMcKeeth
 
Posts: 9
Joined: 30 Apr 2011, 00:20
Has thanked: 7 times
Been thanked: 2 times

Re: HQ Card Gen database update utility

Postby jmarkos » 20 Jun 2012, 07:14

Worked perfectly! Thank you so much Jim! Helped me a lot.

EDIT:
I just found a problem. On the name of the artist the process is writing the number of the card instead of the name.

Here an example (remove the spaces):
h t t p ://s14.postimage.o r g/dztn5c9cf/Divination.png
jmarkos
 
Posts: 2
Joined: 20 Jun 2012, 05:17
Has thanked: 2 times
Been thanked: 0 time

Re: HQ Card Gen database update utility

Postby Burnf » 09 Jul 2012, 15:20

Don't suppose this will work for planechase 2012 and M13? If it does, could someone upload a version of those files? :)

[Edit] Got it to work. You have to add the set names through the Edit menu. I'll test it in a minute. Can anyone walk me through how to upload to this site?
Burnf
 
Posts: 130
Joined: 06 Mar 2009, 15:16
Has thanked: 0 time
Been thanked: 0 time

Re: HQ Card Gen database update utility

Postby Burnf » 11 Jul 2012, 15:14

I can't get the appending tool to work. It says:
Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at GatherToHGCG.GatherToHQCG.GetInput<IList 1 args>
at GatherToHGCG.GatherToHQCG.CsvParse<String inputFile, String outputFile>
at GatherToHGCG.GatherToHQCG.Main<String[] args>
Burnf
 
Posts: 130
Joined: 06 Mar 2009, 15:16
Has thanked: 0 time
Been thanked: 0 time

Re: HQ Card Gen database update utility

Postby VaevictisAsmadi » 11 Aug 2012, 21:24

Very useful, but it does not work for me right now.

I updated Sets.csv and SetCount.csv with all of their missing sets. Used the last CSV card info from GathererDownloader, but even downloading FTV: Legends and up gave me this exception (translated from spanish):
Code: Select all
Gather To HQCG v0.1 by Jim McKeeth

Unhandled exception: System.Collections.Generic.KeyNotFoundException: The given key was not found in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at GatherToHQCG.GatherToHQCG.CsvParse(String inputFile, String outputFile)
   at GatherToHQCG.GatherToHQCG.GetInput(IList`1 args)
   at GatherToHQCG.GatherToHQCG.Main(String[] args)
I'm using Win7x64 with every .NET Framework under the sun installed (and people complain about Python's version hell!), if that is of any help.

I attached the files:
  • gather.csv. Last CSV card info from GathererDownloader that gave me the exception.
  • gather_update.csv. CSV downloaded with GathererDownloader, FTV: Legends and up, that gave me the exception.
  • Sets.csv. Updated up to Magic 2013.
  • SetCounts.csv. Updated up to Magic 2013.
Attachments
setcounts_gatherercsv.zip
Read the above post for explanation of contents.
(2.97 MiB) Downloaded 968 times
VaevictisAsmadi
 
Posts: 8
Joined: 02 Aug 2010, 16:45
Has thanked: 0 time
Been thanked: 0 time

Re: HQ Card Gen database update utility

Postby vittimac » 13 Apr 2014, 14:21

Hello -

I'm new here and was told by a friend about this awesoem tool to help me add data from gatherer to the HQgen app. (Use to do it manually :S)

I am getting an error when try to append to cards.csv. Any idean what it means??:

Input:
GatherToHQCG.exe gather.csv cards.csv

Output:
Application: GatherToHQCG.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IndexOutOfRangeException
Stack:
at GatherToHQCG.GatherToHQCG.CsvParse(System.String, System.String)
at GatherToHQCG.GatherToHQCG.GetInput(System.Collections.Generic.IList`1<System.String>)
at GatherToHQCG.GatherToHQCG.Main(System.String[])
vittimac
 
Posts: 1
Joined: 13 Apr 2014, 14:17
Has thanked: 0 time
Been thanked: 0 time


Return to HQ Card Generator

Who is online

Users browsing this forum: No registered users and 11 guests


Who is online

In total there are 11 users online :: 0 registered, 0 hidden and 11 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 11 guests

Login Form