Quantcast
Channel: Delete multiple rows in csv file - Ask Ubuntu
Viewing all articles
Browse latest Browse all 3

Delete multiple rows in csv file

$
0
0

I'm working on this assignment to delete rows from a CSV file with different customers. I've figured out how to delete one specific customer by using this code:

delete() {
  awk -F "\"*;\"*" '$1 != '$@' {print $ALL}' input.csv > output.csv
}

delete $@

However, now I have to delete multiple customers at the same time. I can identify a customer by their customer number which is stored in the first column of the csv file. I'm supposed to create an array for the different customer numbers and create a while loop to loop through the array, but I can't seem te figure it out.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images