Skip to content

Instantly share code, notes, and snippets.

@megpay
Last active September 24, 2020 16:58
Show Gist options
  • Save megpay/add933716a5907c4c7b4d05597a6ec82 to your computer and use it in GitHub Desktop.
Save megpay/add933716a5907c4c7b4d05597a6ec82 to your computer and use it in GitHub Desktop.
Useful sed commands
#!/bin/sh
# Where I am storing useful sed commands for later use.
# Removing characters from a csv or text file. This removes a double-quote.
sed 's/"//g' filename.csv
sed 's/"//g' filename.csv > filename_new.csv
# Not sed, but using cut to remove columns of a csv file.
# This takes a pipe-delimited file and removes columns 2, 3, and 4.
cut -d '|' -f2-4 filename.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment