title: Bash script to delete line in CSV file
body: <p>I have a CSV file with million records for different users, there are multiple records for each user. I am doing some processing on the file and managed to get the record for each user which I want to delete.</p>
  <p>I am using the below commands, but I can't delete the line I want to</p>
  <pre><code>get_date=$(grep -n &quot;xyz@abc.com&quot;  francis_test.csv| awk -F, '{print $22}' | sed 's/&quot;//g' | awk '{print $1&quot; &quot;$2}'  |  sort -k 1.7n -k 1.4,1.5n -k 1.1,1.2n | tail -n1)
  
  record=$(grep -n &quot;xyz@abc.com&quot;  francis_test.csv| grep &quot;$get_date&quot;)
  </code></pre>
  <p>To delete the record I use the below command</p>
  <pre><code>sed '/&quot;$record&quot;/d'
  </code></pre>