|
Reading text file
Hello,
I have to read a text file, which the first line contains 2 numbers (integers) and then assign these to variables.
Here's the first few lines of the text file:
25 100
SEND 2228161 Hello Pete
RECEIVE 2228161 Hello Chris, how are you?
SEND 2227765 I hate text speak
RECEIVE 2228876 wot u on bout
SEND 2227975 The quick brown fox jumped over the lazy dog
Would I use the String.parseInt(value1) like this
sizeOfMessage = value1;
and String.parseInt(value2)
sizeOfBox
I then have to go on and read different String lines like SEND and RECEIVE
where I have used the if (line.startsWith("SEND")
Thanks for your help
|