Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Format to read in CSV files


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 02-08-2008, 06:41 AM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Thanks Erel, I will do so.
Marc
Reply With Quote
  #12 (permalink)  
Old 02-08-2008, 08:43 AM
LineCutter's Avatar
Senior Member
 
Join Date: May 2007
Location: Daarsit
Posts: 118
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by Stellaferox View Post
I want to store a table containing numbers. The program computes the rank of a hand in poker with 7 cards, taken the best 5 out of it (Texas Holdem). Because there are 133784560 combinations with 7 cards out of 52, it takes too long to compute the hands, especially because I want to run simulations with dealing a lot of hands (Monte Carlo simulation) and compute the probability of winning with that certain hand against other random AI-hands.
You're going to have fun sorting out which hands are valid after you drew the first cards & the subsequent interactions that get you to 7 cards drawn per hand...
Reply With Quote
  #13 (permalink)  
Old 02-08-2008, 10:08 AM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Yeah I know. I worked out to check all 21 combinations of a 5-hand from 7 cards. That works faster then evaluating a 7-hand card I think.
Reply With Quote
  #14 (permalink)  
Old 02-08-2008, 06:22 PM
LineCutter's Avatar
Senior Member
 
Join Date: May 2007
Location: Daarsit
Posts: 118
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I might have the wrong end of the stick - are you simply calculating the probable outcomes for a hand played all the way through, or are you including the role of the evolving shared cards in determining whether you play to the end?
Reply With Quote
  #15 (permalink)  
Old 02-09-2008, 09:45 AM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

The first part of the program is to caculate the outplayed hand (7 cards). With that I can simulate dealing let's say 200000 hands and calcuate probabilities and distribution. Then for the second part I want to calculate probabilities to reach a certain hand with the ongoing play after dealing the several rounds.
The idea is whether I can create a table with pointers after each card to a next table with remaining possibilities. I haven't got it quite clear yet, but the first idea is to build the "mothertable" of all 133784560 combinations.
Marc
Reply With Quote
  #16 (permalink)  
Old 02-09-2008, 01:48 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

But can I get back to the original question? What is the general format/ routine to read in CSV files. There are a number of CSV files on the net that I can use to train my program. After that I can write my own table in BinaryFile.
thnx
Marc
Reply With Quote
  #17 (permalink)  
Old 02-09-2008, 02:56 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,770
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Stellaferox View Post
What is the general format/ routine to read in CSV files
Open one with Wordpad or Notepad. They are just normal text files.

Code:
If FileExist ("text.csv") = true Then
  FileOpen (c1,"text.csv",cRead ,, cASCII)
  r = FileRead (c1)
  Do Until r = EOF
    fields() = StrSplit(r,",")
    Msgbox(fields(0) & " - " & fields (1)) ' do whatever with the fields
   r = FileRead (c1)
  Loop
FileClose (c1)
Reply With Quote
  #18 (permalink)  
Old 02-09-2008, 03:11 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

If you want to parse CSV files you should use Table.LoadCSV.
Reply With Quote
  #19 (permalink)  
Old 07-02-2008, 11:21 PM
Newbie
 
Join Date: Jul 2008
Posts: 5
Default Do not show russian letters

I have a problem:

Table1.LoadCSV("Csv_file.csv",";",False,True)

File of "Csv_file.csv" contains information on Russian language. But the Russian letters are not represented in table cells.
Reply With Quote
  #20 (permalink)  
Old 07-03-2008, 02:21 AM
Newbie
 
Join Date: Jun 2008
Posts: 4
Default

Open your csv in Notepad and save it in UTF-8. Russian letters should appear.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
read and delete sms...how? Byak@ Questions & Help Needed 1 10-12-2008 07:42 PM
PPC Help files format JamesC Questions & Help Needed 4 07-24-2008 01:36 PM
XML file read stratus Questions & Help Needed 8 06-20-2008 04:03 PM
How to know if a PM was read!? Cableguy Forum Discussion 0 05-12-2007 10:17 PM
Read a row (SQL) Nkieto Questions & Help Needed 2 05-03-2007 05:29 PM


All times are GMT. The time now is 03:21 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0