unix - Shell Script for file operation -


this question has answer here:

i have script

awk -f, '$4!~/abcdef/{print $0}' file_name.csv>new_file_name.csv 

this script , deletes entire row in csv file if cell in 19 th (d - column in csv) column consists of abcdef . here giving file name , new file name manually . have pick files in directory , export file directory . how can ?

you can run script in directory contains *csv files:

for f in *.csv;    awk -f, '!($4 ~ /abcdef/)' "$f" > "/dest/dir/$f" done 

Comments