title: How to filter text file and save the result to the new file by java
body: <p>Hello my question is how to filter text file by column, I mean that I want to cut file from range between rows.
  My files are with this kind of data:</p>
  
  <blockquote>
    <p>284015160747447;8935901990807474474;<br>
    284015160747448;8935901990807474482;<br>
    284015160747449;8935901990807474490;<br>
    284015160747450;8935901990807474508;<br>
    284015160747451;8935901990807474516;<br>
    284015160747452;8935901990807474524;<br>
    284015160747453;8935901990807474532;<br>
    284015160747454;8935901990807474540;<br>
    284015160747455;8935901990807474557;<br>
    284015160747456;8935901990807474565;<br>
    284015160747457;8935901990807474573;<br>
    284015160747458;8935901990807474581;<br>
    284015160747459;8935901990807474599;<br>
    284015160747460;8935901990807474607;<br>
    284015160747461;8935901990807474615;<br>
    284015160747462;8935901990807474623;<br>
    284015160747463;8935901990807474631;</p>
  </blockquote>
  
  <p>I want the user to be able to filter what to be written from the original file to the newly created:
  Example from 8935901990807474490 to 8935901990807474532, and for this number the start row and the last row to be in this range.</p>
  
  <pre><code>public class Test_read_file {
      public static List&lt;String&gt; readFile() throws IOException {
          try (BufferedReader br = new BufferedReader(new FileReader("C:\\\\\\\\Users\\\\\\\\Admin\\\\\\\\Desktop\\\\\\\\Work Files\\\\\\\\314-WO0000001133814\\\\\\\\Cards\\\\\\\\MBD10760_182.out"))) {
              List&lt;String&gt; listOfData = new ArrayList&lt;&gt;();
              String d;
              while ((d = br.readLine()) != null) {
                  listOfData.add(d);
              }
              return listOfData;
          }
      }
  
      public static void writeFile(List&lt;String&gt; listOfData) throws IOException {
          try (BufferedWriter bw = new BufferedWriter(new FileWriter("C:\\\\\\\\Users\\\\\\\\Admin\\\\\\\\Desktop\\\\\\\\Work Files\\\\\\\\314-WO0000001133814\\\\\\\\Cards\\\\\\\\MBD10760_187.out"))) {
              for (String str : listOfData) {
                  bw.write(str);
                  bw.newLine();
              }
          }
      }
  
      public static void main(String[] args) throws IOException {
          List&lt;String&gt; data = readFile();
          writeFile(data);
      }
  }
  </code></pre>