Export original HH

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

Export original HH

Postby tgmaster » Wed Apr 15, 2009 7:10 am

Hello!

If I set in the import section that the original HH's will be imported too, then it will be stored in the holdem_hand_histories table. If I write a report that contains a filtered list of these HH's then I can export them into a text file for further use. I have tried quite a lot, but I don't have too much experience in writing such reports.

e.g. How can I export the original HH's that was played since 04.01.09. into a file? Or export other simple filtered HH's?

tx
Gabor
tgmaster
 
Posts: 29
Joined: Wed Mar 12, 2008 5:16 pm

Re: Export original HH

Postby kraada » Wed Apr 15, 2009 12:07 pm

Click Start --> Programs --> PostgreSQL --> psql to 'postgres', at the prompt type \l and hit enter, then \connect 'Your Database Name' and hit enter. The prompt will change to indicate that you have changed databases.

Type \o C:/Hands.txt and hit enter.

Then run this query:

select history from holdem_hand_histories, holdem_hand_player_detail, player, holdem_hand_summary where holdem_hand_histories.id_hand = holdem_hand_player_detail.id_hand and holdem_hand_summary.id_hand = holdem_hand_histories.id_hand and holdem_hand_player_detail.id_player = player.id_player and player.player_name = 'Your Username Here' and holdem_hand_summary.date_played >= '2009-Apr-01';

and all of the hands played on or since 4/1/09 will be exported to the file C:/Hands.txt.

You can change the query or the output file name as needed.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Export original HH

Postby tgmaster » Wed Apr 15, 2009 12:45 pm

I'll try it.
Thanks a lot,
Gabor
tgmaster
 
Posts: 29
Joined: Wed Mar 12, 2008 5:16 pm

Re: Export original HH

Postby WhiteRider » Thu Apr 16, 2009 1:30 pm

If you only want to filter by date, limit or site you could use the Selective Export window.
Tutorial: Selective Export
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Export original HH

Postby tgmaster » Thu Apr 16, 2009 9:34 pm

WhiteRider wrote:If you only want to filter by date, limit or site you could use the Selective Export window.

Tx, but this was only an example. I wanted to filter by hole cards and by hands where I put money in the pot in addition to dates. I think at this moment this script was the only way to solve this. I could extend it accordingly, thanks for u both.
tgmaster
 
Posts: 29
Joined: Wed Mar 12, 2008 5:16 pm

Re: Export original HH

Postby kraada » Fri Apr 17, 2009 9:47 am

Understandable, and you're quite welcome :)
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 2 guests