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.
I am using the below commands, but I can't delete the line I want to
get_date=$(grep -n "[email protected]" francis_test.csv| awk -F, '{print $22}' | sed 's/"//g' | awk '{print $1" "$2}' | sort -k 1.7n -k 1.4,1.5n -k 1.1,1.2n | tail -n1)
record=$(grep -n "[email protected]" francis_test.csv| grep "$get_date")
To delete the record I use the below command
sed '/"$record"/d'
sed -i "///"formate not sed with the d operator