Sounds like you should use the LineNumberReader class. This makes it easy to
handle a file line by line. Parsing can be done easily with the StringTokenizer
class which allows you to specify any delimiter that you want. But why are you
using a text delimited flat file when you could be connecting directly to the
database and getting it that way?

~David




[EMAIL PROTECTED] on 09/01/2000 04:00:37 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:   (bcc: David X Valentine)
Subject:  File Parsing




Hi:


I have a flat text file exported from database, each record is in one line
with line delimiter. Within one line of a record, there are delimiters for
each field of data.
The txt file could have large amount of data. I want to use this text file
as an external data source read them into memory and parse them then follow
my business
logic to handle these data finaly put them into my data server. The
questions are:

1. I certainly have to set buffer size to read number of records into memory
instead of whole file into buffer.  Does anyone have any suggestions on it
to handel it more efficiently?
2. I have to parse the number of records by the predefined delimiters. Does
anyone have any suggestions to parse data more efficiently?
3. Can anyone sugest me on Session bean level or servlet level issue?


Thanks


Larry

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".








This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan & Co. Incorporated, its
subsidiaries and affiliates.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to