title: How do I split a TD string into new rows at the nth occurrence only
body: <p>Below code splits the text of each row in to newly created rows at a certain delimiter.<br>
  By changing the second parameter of the splice method a starting point can be given. Everything after the starting delimiter occurence will be splitted and put on a new row<br></p>
  
  <p>How do I split only the nth occurence of a delimeter? (i.e. the second)</p>
  
  <p>The desired result should be something like this: Start splitting at the second '/' delimiter:</p>
  
  <p>this:<br>
  <strong>PMC37516JG/DMM/1946P/C.Q4.DUMMY</strong></p>
  
  <p>becomes:<br>
  <strong>PMC37516JG/DMM<br>
  1946P/C.Q4.DUMMY</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('#tbl tr').each(function(){
    var $this = $(this);
    var arr = $this.text().split('/');
    var firstTwo = arr.splice(0,2);
    var firstEl = firstTwo.join('/').trim();
    arr.unshift(firstEl);
    var len = arr.length;
    var i;
    var $previous = $this;
    for (i = 0; i &lt; arr.length; ++i) {
      var $tr = $this.clone();
      $tr.find("td").text(arr[i]); 
      $previous.after( $tr );
      $previous = $tr;
    }
    $this.remove();
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>th {
    height: 15px;
    min-width: 30px;
    border: 1px solid black;
    font-size: 12px;
    font-family: Courier, monospace;
    padding: 2px 5px 2px 5px;
  }
  td {
    height: 15px;
    min-width: 30px;
    border: 1px solid black;
    font-size: 12px;
    font-family: Courier, monospace;
    padding: 2px 5px 2px 5px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;table id="tbl"&gt;
    &lt;thead&gt;
      &lt;tr class="tbl-header"&gt;
        &lt;th&gt;1&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;UWS&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;DA8101A/12.DOH&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC37516JG/DMM/1946P/C.Q4.DUMMY&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC18713DA/DMM/2118P/C.Q4&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC17854DA/DMM/1884P/C.Q5.KIKKER&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC18964DA/DMM/1270P/C.Q5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC13312DA/DMM/1500P/C.Q5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC81630FF/DMM/2316P/C.Q5.DUMMY&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC73647FF/DMM/2540P/C.Q5.DUMMY&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC15970DA/DMM/2780P/C.Q5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC19458DA/DMM/2644P/C.Q5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC13485DA/DMM/2382P/C.Q5.KIKKER&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC88130FF/DMM/2450P/C.Q5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC13913DA/DMM/2930P/C.Q5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC19689DA/DMM/3298P/C.Q5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PGA2002DA/ORD/2155P/C.Q5.TRANSIT&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC11453DA/DMM/3212P/C.Q5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC17664DA/ORD/1800P/C.Q4.TRANSIT&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC90443FF/DMM/520P/C.Q5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC16529DA/DMM/624P/C.Q5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC72784FF/DMM/4218P/C.Q5.DUMMY&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC94058FF/DMM/3120P/C.Q5.DUMMY&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC91247FF/DMM/3466P/C.Q5.KIKKER&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC38632JG/DMM/3094P/C.Q5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC19767DA/DMM/3778P/C.Q5&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC16397DA/ORD/1420P/C.Q4.TRANSIT&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC12044DA/DMM/2672P/C.Q4&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC37949JG/DMM/1672P/C.Q6&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC13278DA/ORD/928P/C.PLD.TRANSIT&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC11256DA/ORD/1595P/C.PLD.TRANSIT&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC18938DA/ORD/1458P/C.PLD.TRANSIT&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC12294DA/ORD/4140P/C.PLD.TRANSIT&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC14236DA/ORD/4136P/C.PLD.TRANSIT&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC13867DA/ORD/4126P/C.PLD.TRANSIT&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC7523DA/ORD/4152P/C.PLD.TRANSIT&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC18036DA/ORD/4122P/C.PLD.TRANSIT&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC10478DA/DMM/1548P/C.PWG&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;-PMC88389FF/DMM/1164P/C.PLD&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>