I think it depends on the format of your data and how consistent that format is. But I was able to do something like this with a couple sedcmd entries in props.conf.
Here is my test data
blah,meh,fruitcake,huh,good gift
meh,huh,fruit cake,blah,good gift
meh,huh,drone,blah,good gift
blah,huh,socks,me,bad gift
blah,meh,fruitcake,huh,ok gift
And here are the sedcmd entries I'm using in props
SEDCMD-test1 = s/^([^,]+,){2}(fruitcake|fruit cake),([^,]+,){1}/&replace me,/g
SEDCMD-test2 = s/replace me,[^,]+/bad gift/g
So I'm using sed twice. The first time, I grab everything up to my gift_type field if it includes fruitcake and replace that with the exact same string (the ampersand) but add another field called "replace me". If fruitcake isn't there, then nothing gets replaced.
The second sedcmd finds replace me and then gift_type and replaces that all with just "bad gift". If the "replace me" string isn't there, nothing gets replaced. With this simple data set it seems to work. Where expected, the gift type was set to "bad gift". The other fields were left alone.
I'm not sure if this will affect anything else that you do at parse time. And I'm not sure if this will work for your data set in general. And there may be a better way to do it. But maybe this will at least point you in the right direction.
... View more