Re: Reading in chunks of data



"Paul.Lee.1971@xxxxxxxxx" <Paul.Lee.1971@xxxxxxxxxxxxxx> wrote in message
news:95d784e4-4f19-4bc4-a0fb-84f218cca39b@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I'm reading up on the use of the RandomAccessFile (and other file I/O)
classes in Java but I haven't found anything that can help me. Is
there any way to read in data structured in a text file, as follows:

Apr 10
"The Book of the Dead"
£17.95
Apr 13
"Unconvention Highlights"
£4.99
Apr 14
"Miserable Quotients"
£0.02

etc. etc.

So that I can do the following (in pseudo code):
read first three lines: first line assigned to date value, second to
book title, third to cost variable
read next three lines: first line assigned to date value, second to
book title, third to cost variable
etc.
[ SNIP ]

*********************************

Try java.util.Scanner

AHS


.



Relevant Pages

  • Reading in chunks of data
    ... I'm reading up on the use of the RandomAccessFile (and other file I/O) ... classes in Java but I haven't found anything that can help me. ...
    (comp.lang.java.programmer)
  • Re: Save output from rendering in file
    ... Reading back from 3D cards is generally slow. ... rendering to the card. ... the file I/O and just be reading the data back from the GPU. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: how to wait for socket communications
    ... actually at this point I am ready to try out your file I/O suggestion. ... The picture information is an unsigned char*, with first all the red values ... the JVM when the Java program gets closed, and ending up with memory leaks. ... to use socket communication between my C++ program and my Java program. ...
    (microsoft.public.win32.programmer.networks)
  • Re: how to wait for socket communications
    ... actually at this point I am ready to try out your file I/O suggestion. ... the JVM when the Java program gets closed, and ending up with memory leaks. ... to use socket communication between my C++ program and my Java program. ... int sockfd; ...
    (microsoft.public.win32.programmer.networks)
  • Re: RandomAccessFile.readLine() returns an empty string
    ... >>The text file in question consists of lines of 128 chars, ... > RandomAccessFile is for when you want to read the lines is random ... > For sample code go to the File I/O Amanuensis, and tell it you want to ... The File I/O Amenuensis offered enough examples for me to figure out how ...
    (comp.lang.java.help)

Loading