hi, how can i read a text file and remove blank space between two lines? how can i concat the first message and second message without putting the blank space between them. thank you very much.
for example:
[Message] This my message but the next message is between blank space
Message is continued here
my code is :
BufferedReader input = null;
try {
//reads one line at a time
input = new BufferedReader( new FileReader(aFile) );
String line = null; //not declared within while loop
while (( line = input.readLine()) != null){
System.out.println(line);
}
}
catch (FileNotFoundException ex) {
ex.printStackTrace();
}
for example:
[Message] This my message but the next message is between blank space
Message is continued here
my code is :
BufferedReader input = null;
try {
//reads one line at a time
input = new BufferedReader( new FileReader(aFile) );
String line = null; //not declared within while loop
while (( line = input.readLine()) != null){
System.out.println(line);
}
}
catch (FileNotFoundException ex) {
ex.printStackTrace();
}