Page 1 of 1

HQ Card Gen database update utility

PostPosted: 04 Apr 2012, 20:27
by JimMcKeeth
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.

Re: HQ Card Gen database update utility

PostPosted: 07 Apr 2012, 09:54
by Huggybaby
We love helpful utilities here, please post it!

Re: HQ Card Gen database update utility

PostPosted: 10 Apr 2012, 14:47
by odino182
can you post it pls? i really need it :)

Re: HQ Card Gen database update utility

PostPosted: 12 Apr 2012, 02:03
by JimMcKeeth
I am cleaning it up and making it slightly configurable so it is useful for people besides myself. Will post it soon.

Re: HQ Card Gen database update utility

PostPosted: 15 Apr 2012, 08:44
by JimMcKeeth
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.

Re: HQ Card Gen database update utility

PostPosted: 15 Apr 2012, 13:20
by odino182
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.

Re: HQ Card Gen database update utility

PostPosted: 15 Apr 2012, 17:01
by JimMcKeeth
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?

Re: HQ Card Gen database update utility

PostPosted: 15 Apr 2012, 18:45
by odino182
it get the first information english oracle print text, because the italian information come after

Re: HQ Card Gen database update utility

PostPosted: 26 Apr 2012, 19:22
by JimMcKeeth
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.

Re: HQ Card Gen database update utility

PostPosted: 20 Jun 2012, 07:14
by jmarkos
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

Re: HQ Card Gen database update utility

PostPosted: 09 Jul 2012, 15:20
by Burnf
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?

Re: HQ Card Gen database update utility

PostPosted: 11 Jul 2012, 15:14
by Burnf
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>

Re: HQ Card Gen database update utility

PostPosted: 11 Aug 2012, 21:24
by VaevictisAsmadi
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.

Re: HQ Card Gen database update utility

PostPosted: 13 Apr 2014, 14:21
by vittimac
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[])