Trying to extract specfic data with split
<p>i have this txt file name contacts.txt that contains this:</p>

<pre><code>kate|female|kathryn bailey beckinsale|26-jul-1973|#23 underworld drive|(621) 142-7827|kate@lycans.net
jessica|female|jessica claire biel|03-mar-1982|27 texas avenue|(53)2344223|jbiel@yahoo.com
johnny|male|john christopher depp ii|09-jun-1963|711 pirate road|(773) 476-6634|jspaw@piratebay.org
</code></pre>

<p>my script is this:</p>

<pre><code>function syncText() {
var xhr = new XMLHttpRequest();
xhr.open("get", "data/contacts.txt", false);
xhr.send(null);

  if (xhr.status == 200) {
    var data = xhr.responseText;
    var items = data.split("|");
    items.sort();
    var div = document.getElementById("header2");

  for (var i = 0; i &lt; items.length; i++) {
    var p = document.createElement("p");
    var text = document.createTextNode(items[i]);
    p.appendChild(text);
    div.appendChild(p);
  }
  } else {
    alert("data retrieval failed...");
  }
}
</code></pre>

<p>The HTML is this:</p>

<pre><code>&lt;div id="header2"&gt;
  &lt;button onclick="syncText()"&gt;Load&lt;/button&gt;    
&lt;/div&gt;`
</code></pre>

<p>i only want to retreive kat, jessica, johnny.. please help me</p>
