how to splite 5 lines by \n from file in java code example Example: split by new line java String lines[] = string.split("\\r?\\n");