Split file depending on Column Value

Hi ,

my file look likes below ,

cat file.csv

12/09/2014,50,5,0,300
12/09/2014, ,5,0,300
12/09/2014,50,,,300
 

i need to split file , the first one contains values (2nd column is 50 , 3rd and fourth column is null )
the second file contains all others

firstfile

12/09/2014,50,,,300

secondfile

12/09/2014,50,5,0,300
12/09/2014, ,5,0,300

Hi,
try:

$ cat cutsed.sed
/^[^,]\+,[^,]\+,,,/wfirstfile
/^[^,]\+,[^,]\+,,,/!wsecondfile

and launch:

sed -f cutsed.sed file.csv
awk -F, '{if ($2=="50" && $3$4=="") {print >"firstfile"} else {print >"secondfile"}}' file.csv

and the sed solution should be

/^[^,]*,50,,,/wfirstfile
/^[^,]*,50,,,/!wsecondfile