Workaround for exporting Known Cards w/ Suits to excel.

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Workaround for exporting Known Cards w/ Suits to excel.

Postby gkeuler » Thu Sep 09, 2010 7:20 am

I found a workaround for anyone else wanting to export a custom report to excel and still maintain the suits of the known cards instead of the 2-14 values that are displayed currently. First duplicate any statistic that results in a minicard being displayed within a custom report and replace its value expression with its Format expression and saving the new statistic under a new name. Using the new stat in a custom report will still display the card as always but when you export to a .csv the value imported into excel will look something like this,

{IMG:Icons/minicards.png|240,28,20,14}
{IMG:Icons/minicards.png|120,0,20,14}
{IMG:Icons/minicards.png|160,0,20,14}

The numbers on the end represent the individual card and I can only assume they actually represent pixels within that png. Every card ends in 20,14. So only the first two numbers matter. |240,28,20,14}

The first represents the rank the second represents the suit. The numeric values of the ranks break down like so, Ace=240, King=220,Queen=200 and so on down to 2=0. The 2nd value is the suit which looks like so..... 0=clubs, 14=diamonds, 28=Hearts and 42=spades.

thus 240,28,20,14=ace of hearts
120,0,20,14=Eight of clubs.

Once exported into excel, run a macro which replaces each numeric code with its corresponding card ie- Find *100,14,20,14* replace with 7d
gkeuler
 
Posts: 27
Joined: Fri Jan 29, 2010 5:17 am

Re: Workaround for exporting Known Cards w/ Suits to excel.

Postby kraada » Sat Sep 11, 2010 9:34 am

Thanks for this!
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 0 guests