你好,我正在爲大學進行一個Java項目,我應該在那裏分析撲克牌。我在txt日誌文件中發現了一些撲克牌。撲克之手 - 解析Java中的日誌文件
他們通常是這樣的:
PokerStars Zoom Hand #86981279921: Hold'em No Limit ($0.10/$0.25 USD) - 2012/09/30 23:49:51 ET
Table 'Whirlpool Zoom 40-100 bb' 9-max Seat #1 is the button
Seat 1: lgwong ($30.99 in chips)
Seat 2: hastyboots ($28.61 in chips)
Seat 3: seula i ($25.31 in chips)
Seat 4: fr_kevin01 ($31.81 in chips)
Seat 5: limey05 ($27.45 in chips)
Seat 6: sanlu ($24.65 in chips)
Seat 7: Masterfrank ($25.35 in chips)
Seat 8: Refu$e2Lose ($33.23 in chips)
Seat 9: 1pepepe0114 ($37.62 in chips)
hastyboots: posts small blind $0.10
seula i: posts big blind $0.25
*** HOLE CARDS ***
fr_kevin01: folds
limey05: folds
sanlu: folds
Masterfrank: folds
Refu$e2Lose: folds
1pepepe0114: folds
lgwong: folds
hastyboots: folds
Uncalled bet ($0.15) returned to seula i
seula i collected $0.20 from pot
seula i: doesn't show hand
*** SUMMARY ***
Total pot $0.20 | Rake $0
Seat 1: lgwong (button) folded before Flop (didn't bet)
Seat 2: hastyboots (small blind) folded before Flop
Seat 3: seula i (big blind) collected ($0.20)
Seat 4: fr_kevin01 folded before Flop (didn't bet)
Seat 5: limey05 folded before Flop (didn't bet)
Seat 6: sanlu folded before Flop (didn't bet)
Seat 7: Masterfrank folded before Flop (didn't bet)
Seat 8: Refu$e2Lose folded before Flop (didn't bet)
Seat 9: 1pepepe0114 folded before Flop (didn't bet)
我的問題是,我不知道如何着手分析日誌文件: 我唯一的知識是「手動」掃描線按特定字符或符號排隊,但恐怕需要徹底的錯誤處理。
所以我徘徊,如果有任何其他技術或更好的方式來解析這些撲克牌手?
非常感謝您的幫助
編輯:對不起,「數據挖掘」,因爲它是不是問題的一部分。
EDIT2:我也一直在尋找一些Java方法做同樣的C++
例如: 在C++中讀出5個字符/直到德#符號是:myfile.getline(store_in_this_var,5」 #'),你能否建議我採用一些Java方法來做同樣的事情?
這不是數據挖掘通過所有= \ –
*我唯一的知識是 「手動」 掃描線用於特定字符或符號的行*是的,這是這個任務的目的(至少它看起來如何) 。你有什麼嘗試? –
正則表達式? –