title: awk get the nextline
body: <p>i'm trying to use awk to format a file thats contains multiple line.
  <br>Contains of file:</p>
  
  <pre><code>ABC;0;1
  ABC;0;0;10
  ABC;0;2
  EFG;0;1;15
  HIJ;2;8;00
  KLM;4;18;12
  KLM;6;18;1200
  KLM;10;18;14
  KLM;1;18;15
  </code></pre>
  
  <p>result desired:</p>
  
  <pre><code>ABC;0;1;10;2
  EFG;0;1;15
  HIJ;2;8;00
  KLM;4;18;12;1200;14;15
  </code></pre>
  
  <p>I am using the code below :</p>
  
  <pre><code>awk -F ";" '{
          ligne= ligne $0
          ma_var = $1
          {getline
          if($1 != ma_var){
              ligne= ligne "\n" $0
          }
          else {
          ligne= ligne";"NF
          }
          }   
  }
  END {
      print ligne
  } ' ${FILE_IN} &gt; ${FILE_OUT}
  </code></pre>
  
  <p>the objectif is to compare the first column of the next line to the first column the current line, if it matches then add the last column of the next line to the current line, and delete the next line, else print the next line.</p>
  
  <p>Kind regards,</p>