I am reading a file containing keywords line by line and found a strange problem. I hope lines that following each other if their contents are the same, they should be handl
Try trimming whitespace at the beginning and end of lines read. Just replace your while with:
while ((strLine = bufferedReader.readLine()) != null) {
strLine = strLine.trim();
logger.info(Arrays.toString(strLine.toCharArray()));
if(strLine.contentEquals(prevLine)){
logger.info("Skipping the duplicate lines " + strLine);
continue;
}
prevLine = strLine;
}