How to remove all blank spaces and empty lines from a txt File using Java SE?
Input:
qwe
qweqwe
qwe
qwe
Output:
qwe
qweqwe
qwe
qwe
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How about something like this:
Note – not tested, may not be perfect syntax but gives you an idea/approach to follow.
See the following JavaDocs for reference purposes:
http://download.oracle.com/javase/7/docs/api/java/io/FileReader.html
http://download.oracle.com/javase/7/docs/api/java/io/FileWriter.html