@sandatomo: Try(untested):
awk -F, -vs1="\"" 'NR>1{gsub(/\"/,"",$8);if($8==1){sub(/.*/,s1 "success" s1,$8)};if($8==2){sub(/.*/,s1 "check" s1,$8)};if($8=="null"){sub(/.*/,s1 "undefined" s1,$8)};print}' OFS=, Input_file
EDIT: Adding a non-one liner form of solution too now.
awk -F, -vs1="\"" 'NR>1{
gsub(/\"/,"",$8);
if($8==1){
sub(/.*/,s1 "success" s1,$8)
};
if($8==2){
sub(/.*/,s1 "check" s1,$8)
};
if($8=="null"){
sub(/.*/,s1 "undefined" s1,$8)
};
print
}
' OFS=, Input_file
EDIT2: I tested my code previous code and it was not having field separator as "," so edited it now.
EDIT3: Explanation of above.
awk -F, -vs1="\"" 'NR>1{ ##### Setting Field separator as comma(,). Creating a variable named s1 whose value is a quote("). Then Checking here if current line number is greater than 1.
##### If above condition is TRUE then all following statements will be executing.
gsub(/\"/,"",$8); ##### substituting all quotes(") in $8 now.
if($8==1){ ##### Check if 8th field value is 1, if yes then it will execute following statement.
sub(/.*/,s1 "success" s1,$8) ##### substitute everything in $8 with s1 "success" s1
};
if($8==2){ ##### Similarly like above checking if $8's value is 2
sub(/.*/,s1 "check" s1,$8) ##### Then substitute the $8's value with s1 "check" s1
};
if($8=="null"){ ##### checking if $8's value is "null" here
sub(/.*/,s1 "undefined" s1,$8) ##### substituting the complete value of $8 with s1 "undefined" s1.
};
print ##### printing the whole line now.
}
' OFS=, Input_file ##### Setting output field separator as a comma. Then mentioning the Input_file here.
=assigns the value on the RHS to the name on the LHS. To test for equality, use==, soif($8==1).... You also need to tellawkto split fields on the,char, with either awk -F, '{...}' file` ORawk 'BEGIN{FS=","}{....}' file. What happens when there are,s inside the dbl-quoted data? Kaboom! ... So much better to use a <tab> char to separate fields in your data file (or maybe|char). Good luck.csvtool.