Line Feed -- Need Help

Hi,

I have an array of string like below. I need to split this into three different chunks depending on the position of Carriage return Can someone please tell me the code for this? I am new to Java and I need this Urgently. Any help in this regard will be highly appreciated

example:- I need to put these a, b, c strings into 3 different variables.

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

[764 byte] By [RonyPonya] at [2007-10-3 7:43:52]
# 1
Do you mean you want to separate the chunks by blank lines? And how do you want to store the individual chunks, in separate String[]s?
hunter9000a at 2007-7-15 2:45:01 > top of Java-index,Java Essentials,Java Programming...
# 2

> Do you mean you want to separate the chunks by blank

> lines? And how do you want to store the individual

> chunks, in separate String[]s?

Yes I want to store these 3 strings in different variables.

for examples stringa = aaaaaaaaaaaaaaaaaa

stringb = bbbbbbbbbbbbbbbbbb

stringc = ccccccccccccccccccccc

RonyPonya at 2007-7-15 2:45:01 > top of Java-index,Java Essentials,Java Programming...
# 3
Nope. Still get no idea what you are trying to do. Where are all these letters stored now?
floundera at 2007-7-15 2:45:01 > top of Java-index,Java Essentials,Java Programming...
# 4

Ok Let me explain in detail. Say these texts are in a NotePad. My Program should read tex file. As soon as this hits the Lineor \n, this should put all the characters upto this point into one string variable. In this case, at the end of a's there is a line feed. So all aaaaa's should be put into one string variable. Then the next Line feed comes at the end of B's so all the bbbbb's should be put in another variable. And So on.

I hope this clarifies what I am intending to do.

RonyPonya at 2007-7-15 2:45:01 > top of Java-index,Java Essentials,Java Programming...
# 5
In that case you need a FileReader wrapped in a BufferedReader. Call readLine and assign it to a variable.BufferedReader reader = new ......String strA = reader.readLine();String strB = etc....
floundera at 2007-7-15 2:45:01 > top of Java-index,Java Essentials,Java Programming...