title: Count number of line in txt file when new line is inside data
body: <p>I have one txt file which has below data</p>
  <pre><code>Name    mobile  url message text
  test11  1234567890  www.google.com  &quot;Data Test New
  Date:27/02/2020
  Items: 1
  Total: 3
  Regards
  ABC DATa
  Ph:091 : 123456789&quot;
  test12  1234567891  www.google.com  &quot;Data Test New one
  Date:17/02/2020
  Items: 26
  Total: 5
  Regards
  user test
  Ph:091 : 433333333&quot;
  </code></pre>
  <p>Now you can see my last column data has new line character. so when I use below command</p>
  <pre><code>awk 'END{print NR}' file.txt
  </code></pre>
  <p>it is giving my length is 15 but actually line length is 3 . Please suggest command for the same</p>
  <p>Edited Part:
  As per the answer given the below script is not working if there's no newline at the end of input file</p>
  <pre><code>awk -v RS='&quot;[^&quot;]*&quot;' '{gsub(/\n/, &quot; &quot;, RT); ORS=RT} END{print NR &quot;\n&quot;}' test.txt 
  </code></pre>
  <p>Also my file may have 3-4 Million of records . So converting file to unix format will take time and that is not my preference.
  So Please suggest some optimum solution which should work in both case</p>
  <pre><code>head 5.csv | cat -A  
  Above command is giving me the output
  </code></pre>
  <p>Name    mobile  url message text^M$</p>