I am at a lost as to where to begin... I need to read data from a file (Example: 2c 4h 5d 9s) then according to what letter is next to the number, I place in the proper array spot. (So I am guessing multi-dimensional array?) Umm... data is 13 'couplets' and I am at a total loss of where to begin. Do I need to use a string tokenizer, get one couplet, and then how do I tell from the couplet what letter it is.... I keep thinking this has to be simple, and I am just thinking too complex. I'm just not sure how to read mixed data types from a file (int/char pairs), and then how to figure out specifically what letter is from each pair. ANYWAY... ANY help at all on this problem would be MOST appreciated!!! Jon
You could try the following: create a BufferedReader that is connected to a FileReader that is created using your file. using readLine() you can read the lines of the file one at a time into a String then tokenize the String you just read into smaller strings. Then you could use the charAt() method of the String class to get each character. Hope this helps
Joined: Jan 28, 2004
Okay, thanks for the tip! Does this look like proper code for a situation for this?
or is this not legal usage of charAt? Can I parse it like that? Any answers will be appreciated!! Jon
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com