title: counting number of lines in a text/csv file using OSB
body: <p>I have a CSV file, I need to count the total number of lines in that file. This I have to use in OSB. My requirement is I have to count total no of lines in the $body file (CSV/flat file) and subtract header and footer lines from it, using either XSLT/Xquery.</p>
  
  <p>EX:</p>
  
  <pre><code>header,1, @total_no_of_detal@
  detail,1
  detail,2
  detail,3
  "
  "
  detail,n
  
  footer, 1
  </code></pre>
  
  <p>If suppose i have 10 detail lines, and I am getting body of the file as shown above,</p>
  
  <p>then in the final file, I have to change the body of the file as:</p>
  
  <pre><code>header,1, 10
  detail,1
  detail,2
  detail,3
  "
  "
  detail,n
  
  footer, 1
  </code></pre>
  
  <p>Please advice how to do this in OSB.</p>