public class DataSeperation { public static void main(String[] args) throws IOException { BufferedReader rd=new BufferedReader(new FileReader("D:\\Data.txt")); File tempFile = new File("myTempFile.txt"); BufferedWriter writer = new BufferedWriter(new FileWriter(tempFile)); String lineToRemove = "208 vaDgaava SaorI ivaQaanasaBaa matadar saMGa : dubaar matadar yaadI Ah-taa idnaaMkx : 1ó1ó2013 va pa`isawI idnaaMkx : 1ó10ó2012"; String currentLine; while((currentLine =rd.readLine()) != null) { // trim newline when comparing with lineToRemove String trimmedLine = currentLine.trim(); if(trimmedLine.equals(lineToRemove)) continue; writer.write(System.getProperty("line.separator")); writer.write(currentLine); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)