title: Shell script command to drop a column from CSV file
body: <p>I am trying to drop a column (I get this as variable from pre-process) from a csv file.</p>
  
  <p>I looked at examples provided and tried the below </p>
  
  <pre><code>cut -d ',' -f 2 X.csv &gt; Y.csv
  </code></pre>
  
  <p>Above command is not helping - 2nd column from X.csv is copied to Y.csv</p>
  
  <p>I want 2nd column to be dropped along with the delimiter </p>
  
  <p>Eg: </p>
  
  <pre><code>name,place,animal
  a,chicago,python
  b,new york,squirrel
  </code></pre>
  
  <p>After using cut command the file should look like</p>
  
  <pre><code>name,animal
  a,python
  b,squirrel
  </code></pre>