Make script smaller

I have the following script

sed s/,/	/g output.csv | awk "$14=="309"||$14=="311"||$14=="322"||$14=="359"||$14=="369"||$14=="331"||$14=="332" {print}"

I need to add more conditions but if possible, I’d like to make it smaller (I have 66 conditions to filter a file by but it the command will need to be pasted into a word document (to say what command I used) so ideally I need to shorten it. Is there any way of doing so?

You could set the field separator with -F"," and get rid of the sed command

Is it always $14 you are testing against a defined set of values ?

Yeah - always column 14

Hadn’t considered the -F function in awk.

EDIT:
For some reason, that command above didn’t work - it would write about 3MB of data then stop.
However the following batch script worked.


::Script
E:
cd "./Directory"
sed -n 1p File.csv > Filtered.csv
awk -F , "$14=="9" {print}" File.csv >> Filtered.csv
awk -F , "$14=="109" {print}" File.csv >> Filtered.csv
awk -F , "$14=="113" {print}" File.csv >> Filtered.csv
awk -F , "$14=="121" {print}" File.csv >> Filtered.csv
awk -F , "$14=="122" {print}" File.csv >> Filtered.csv
awk -F , "$14=="123" {print}" File.csv >> Filtered.csv
awk -F , "$14=="129" {print}" File.csv >> Filtered.csv
awk -F , "$14=="131" {print}" File.csv >> Filtered.csv
awk -F , "$14=="133" {print}" File.csv >> Filtered.csv
awk -F , "$14=="141" {print}" File.csv >> Filtered.csv
awk -F , "$14=="142" {print}" File.csv >> Filtered.csv
awk -F , "$14=="144" {print}" File.csv >> Filtered.csv
awk -F , "$14=="146" {print}" File.csv >> Filtered.csv
awk -F , "$14=="151" {print}" File.csv >> Filtered.csv
awk -F , "$14=="152" {print}" File.csv >> Filtered.csv
awk -F , "$14=="161" {print}" File.csv >> Filtered.csv
awk -F , "$14=="162" {print}" File.csv >> Filtered.csv
awk -F , "$14=="163" {print}" File.csv >> Filtered.csv
awk -F , "$14=="174" {print}" File.csv >> Filtered.csv
awk -F , "$14=="175" {print}" File.csv >> Filtered.csv
awk -F , "$14=="176" {print}" File.csv >> Filtered.csv
awk -F , "$14=="178" {print}" File.csv >> Filtered.csv
awk -F , "$14=="179" {print}" File.csv >> Filtered.csv
awk -F , "$14=="181" {print}" File.csv >> Filtered.csv
awk -F , "$14=="182" {print}" File.csv >> Filtered.csv
awk -F , "$14=="183" {print}" File.csv >> Filtered.csv
awk -F , "$14=="185" {print}" File.csv >> Filtered.csv
awk -F , "$14=="186" {print}" File.csv >> Filtered.csv
awk -F , "$14=="189" {print}" File.csv >> Filtered.csv
awk -F , "$14=="219" {print}" File.csv >> Filtered.csv
awk -F , "$14=="249" {print}" File.csv >> Filtered.csv
awk -F , "$14=="261" {print}" File.csv >> Filtered.csv
awk -F , "$14=="309" {print}" File.csv >> Filtered.csv
awk -F , "$14=="311" {print}" File.csv >> Filtered.csv
awk -F , "$14=="322" {print}" File.csv >> Filtered.csv
awk -F , "$14=="331" {print}" File.csv >> Filtered.csv
awk -F , "$14=="332" {print}" File.csv >> Filtered.csv
awk -F , "$14=="341" {print}" File.csv >> Filtered.csv
awk -F , "$14=="345" {print}" File.csv >> Filtered.csv
awk -F , "$14=="359" {print}" File.csv >> Filtered.csv
awk -F , "$14=="369" {print}" File.csv >> Filtered.csv
awk -F , "$14=="409" {print}" File.csv >> Filtered.csv
awk -F , "$14=="449" {print}" File.csv >> Filtered.csv
awk -F , "$14=="469" {print}" File.csv >> Filtered.csv
awk -F , "$14=="489" {print}" File.csv >> Filtered.csv
awk -F , "$14=="509" {print}" File.csv >> Filtered.csv
awk -F , "$14=="511" {print}" File.csv >> Filtered.csv
awk -F , "$14=="581" {print}" File.csv >> Filtered.csv
awk -F , "$14=="585" {print}" File.csv >> Filtered.csv
awk -F , "$14=="591" {print}" File.csv >> Filtered.csv
awk -F , "$14=="593" {print}" File.csv >> Filtered.csv
awk -F , "$14=="597" {print}" File.csv >> Filtered.csv
awk -F , "$14=="659" {print}" File.csv >> Filtered.csv
awk -F , "$14=="700" {print}" File.csv >> Filtered.csv
awk -F , "$14=="815" {print}" File.csv >> Filtered.csv
awk -F , "$14=="881" {print}" File.csv >> Filtered.csv
awk -F , "$14=="882" {print}" File.csv >> Filtered.csv
awk -F , "$14=="888" {print}" File.csv >> Filtered.csv
awk -F , "$14=="891" {print}" File.csv >> Filtered.csv
awk -F , "$14=="900" {print}" File.csv >> Filtered.csv
awk -F , "$14=="901" {print}" File.csv >> Filtered.csv
awk -F , "$14=="904" {print}" File.csv >> Filtered.csv
awk -F , "$14=="909" {print}" File.csv >> Filtered.csv
awk -F , "$14=="926" {print}" File.csv >> Filtered.csv
awk -F , "$14=="953" {print}" File.csv >> Filtered.csv
awk -F , "$14=="959" {print}" File.csv >> Filtered.csv

Got to love linux commands in Windows thanks to GNUWin32