Results 1 to 2 of 2
- 02-29-2012, 03:01 AM #1
Member
- Join Date
- Feb 2012
- Posts
- 3
- Rep Power
- 0
bufferedReader (or alternative)? Help!
Ok, have to read a file over the network. The way I'm going about the project I'm splitting the file into strings, placing the strings into an array. The strings are separated by '%' so I'm using that as my delimiter. I'm using bufferedreader. If the strings are 1 lines, everything is fine
e.g.
the brown fox ran quickly.
returns
the brown fox ran quickly.
however if the strings are multiple lines, only the last line gets returned.
e.g.
the brown fox ran quickly.
the red fox ran quicker.
the orange fox was even faster.
returns
the orange fox was even faster.
hopefully that makes sense? question is i know buffered reader reads at a line at a time, so it seems by design it SHOULD only be printing the last line prior to the delimiter, but how can I make it read/output ALL the lines up until the previous delimiter? Is bufferedreader what I should be using for this? Possibly something else would work better?
Thanks much in advance!
- 02-29-2012, 04:56 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Re: bufferedReader (or alternative)? Help!
Can you show us how did you read strings in your code?
Similar Threads
-
Which would be the most effecient alternative?
By Krystah in forum New To JavaReplies: 3Last Post: 04-18-2011, 10:56 PM -
BufferedReader alternative for large input
By HannesV in forum Advanced JavaReplies: 0Last Post: 10-19-2010, 04:56 PM -
Is EJB an alternative for JDBC?
By makpandian in forum Enterprise JavaBeans (EJB)Replies: 4Last Post: 01-06-2010, 09:14 AM -
Looking for alternative to Web Start
By SamSam in forum Advanced JavaReplies: 1Last Post: 05-06-2009, 07:19 PM -
Any Alternative to Swing?
By Niveditha in forum AWT / SwingReplies: 13Last Post: 06-27-2008, 09:39 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks