melsterTEK
Programmer
I am trying to create a csv file, the catch is I have to do some data validation and/or pattern matching of some sort to create the final file.
I need to go through the given column where some columns have data values that are separated by commas “,” like so:
Requirements:
-Validate the number of coma separated values
-If validation fails, generate a valid entry with blank coma separated values
Example;
S_YSVACCEPT = "4.12,YSV5,7830" OK, 3 comma separated values
S_YSVACCEPT = "4.12,YSV5," OK, 3 comma separated values
S_YSVACCEPT = "4.12,YSV5" Bad, only 2 comma separated, you should return ", ,"
S_YSVACCEPT = "foo,faa,blah,kaa" Bad, 4 comma separated value, you should return ", ,"
S_YSVACCEPT = "0" Bad, only 1 comma separated value, you should return ", ,"
Can someone help me with this logic? Thanks.
I need to go through the given column where some columns have data values that are separated by commas “,” like so:
Requirements:
-Validate the number of coma separated values
-If validation fails, generate a valid entry with blank coma separated values
Example;
S_YSVACCEPT = "4.12,YSV5,7830" OK, 3 comma separated values
S_YSVACCEPT = "4.12,YSV5," OK, 3 comma separated values
S_YSVACCEPT = "4.12,YSV5" Bad, only 2 comma separated, you should return ", ,"
S_YSVACCEPT = "foo,faa,blah,kaa" Bad, 4 comma separated value, you should return ", ,"
S_YSVACCEPT = "0" Bad, only 1 comma separated value, you should return ", ,"
Can someone help me with this logic? Thanks.