How To Delete The First Column In A CSV File Inside a Bash Script

You’re writing a script that maybe works with a CSV that you’ve downloaded as a cron job and want to delete the first column so that it uploads nicely somewhere else, maybe to a MySQL database.

Delete the first column:

1
sed -i 's/[^,]*,//' thespreadsheet.csv

Delete the first two columns:

1
sed -i 's/[^,]*,//' thespreadsheet.csv
1
sed -i 's/[^,]*,//' thespreadsheet.csv