I'm tring to remove all blank lines in a txt file. What I did was:
Pattern p = Pattern.compile("^\\s*$", Pattern.MULTILINE);
Matcher m = p.matcher(myFile);
System.out.println(m.replaceAll(""));
However, this did not remove the blank lines. Any ideas?
Thanks.