Article View: borland.public.jbuilder.java.language
Article #14414Re: String input from file
From: Steve Horsley
Date: Tue, 07 Sep 1999 00:00
Date: Tue, 07 Sep 1999 00:00
26 lines
1464 bytes
1464 bytes
I would probably use a BufferedReader and its readLine method, then break the line into bits with a java.util.StringTokenizer. I would probably put the bits into three Vectors, then when I've finished reading the file, make arrays the same size as the Vectors and copy the bits accross. (Or can you fill a table from Vectors? - you might have to make a TableModel to do that.) Steve. "John A. Hayes" wrote: > > What is the easiest way to take data from a file and place each sequence > of characters into a String. More specifically I would like to take > data from a file that is in the form: > > 01A02 03A41 9 > 02J23 04L23 8 > 01A02 03A41 9 > 02J23 04L23 8 > > and put it into a two-dimensional String array so that it may later be > put into a table in the form shown. Thanks for any and all help in > advance. > > John Hayes
Technical Details
Message-ID:
<37D4E9AB.AF8C0239@cwcom.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37D48CBD.18E26527@clemson.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,37197691e76fff84 X-Google-Attributes: gidf74b3,public From: Steve Horsley <steve.horsley@cwcom.co.uk> Subject: Re: String input from file Date: 1999/09/07 Message-ID: <37D4E9AB.AF8C0239@cwcom.co.uk> X-Deja-AN: 522038845 Content-Transfer-Encoding: 7bit References: <37D48CBD.18E26527@clemson.edu> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Cable & Wireless Communications Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language