title: Java Extracting values from text files
body: <p>I have many text files (up to 20) and each file has it's contents like this </p>
  
  <pre><code>21.0|11|1/1/1997
  13.3|12|2/1/1997
  14.6|9|3/1/1997
  </code></pre>
  
  <p>and every file has approximately more than 300 lines.</p>
  
  <p>so the problem I'm facing is this, how can I extract all and only the first values 
  of the file's content. </p>
  
  <p>for example I want to extract the values (21.0,13.3,14.6.....etc) so I can decide the max number and minimum in all of the 20 files.</p>
  
  <p>I have wrote this code from my understanding to experience it on of the files 
  but it didn't work  </p>
  
  <pre><code>  String inputFileName = "Date.txt";
   File inputFile = new File(inputFileName);
   Scanner input = new Scanner(inputFile);
   int count = 0;
   while (input.hasNext()){
       double line = input.nextDouble(); //Error occurs "Exception in thread "main" java.util.InputMismatchException" 
       count++;
       double [] lineArray= new double [365];
       lineArray[count]= line;
       System.out.println(count);
        for (double s : lineArray){
         System.out.println(s);
            System.out.println(count);
  </code></pre>
  
  <p>and this one too</p>
  
  <pre><code> String inputFileName = "Date.txt";
   File inputFile = new File(inputFileName);
   Scanner input = new Scanner(inputFile);
  
   while (input.hasNext()){
       String line = input.nextLine();
       String [] lineArray = line.split("//|");
        for (String s : lineArray){
         System.out.println(s+" ");
   }
  </code></pre>
  
  <ul>
  <li>Note: I'm still kind of a beginner in Java</li>
  </ul>
  
  <p>I hope I was clear and thanks </p>