title: Count the number of characters between a specific character(Including spaces)
body: <p>I have a File that is in this format:</p>
  
  <pre><code>City|the Location|the residence of the customer| the age of the customer| the first name of the customer|  
  </code></pre>
  
  <p>I need to read just the first line an determine how many characters are between the sign "|". I need the code to read even the spaces.</p>
  
  <p>This is the code I have:</p>
  
  <pre><code>`FileInputStream fs = new FileInputStream("C:/test.txt");
  BufferedReader br = new BufferedReader(new InputStreamReader(fs));
  StringBuilder sb = new StringBuilder();
  
  for(int i = 0; i &lt; 0; i++){
  br.readLine();
  }
  String line  = br.readLine();
  
  System.out.println(line);
  
  String[] words = line.split("|");
  for (int i = 0; i &lt; words.length; i++) {
      int counter = 0;
      if (words[i].length() &gt;= 1) {
          for (int k = 0; k &lt; words[i].length(); k++) {
              if (Character.isLetter(words[i].charAt(k)))
                  counter++;
          }
          sb = new StringBuffer();
          sb.append(counter).append(" ");
      }
  }
  System.out.println(sb);
  }
  </code></pre>
  
  <p>`</p>
  
  <p>I am very new to java</p>