#1 2010-11-11 05:21:22

mdipper
Member
Registered: 2010-09-03
Posts: 17

Python Hack for Comic Collection to CSV

I found the function that exports to CSV to be painfully slow on my 7 year old PC, and the results still took some tweaking to get into a format I want, so I put together a quick python hack to do exactly what I wanted.

I figured somebody else on this list might find my hack to be a useful starting point to do something similar so I'm attaching it to this post.

My hack takes an XML formatted .gcs file for comic books and creates a properly quoted CSV with values for the comic title, the publisher, and the issue number.  The records are sorted and all duplicates are removed.

Issue numbers for the same title/publisher are also grouped together.  If I have issues 1,2,3,5,7,8,9 of Foo published by Bar, there will be a single entry that looks like this:

Foo, Bar, "1-3, 5, 7-9"

to use the program enter:
python gcsconvert.py -i collection_name -o csv_file_name

Happy Hacking,
-Michael


Attachments:
Attachment Icon gcsconvert.py, Size: 3,873 bytes, Downloads: 433

Offline

 



Should you have a problem using GCstar, you can open a bug report or request some support on GCstar forums.