Dynamic key generator for cbimport

My cbimport command is :
cbimport json -c couchbase://127.0.0.1 -u MYUSER -p MYPASS -b BUCKET1 -d “file:///USER/Test Data/member.json” -f list -g MEMBER_%membermiddlename%%memberId% -l MEMBER.log -e ERROR.err .
In the member.json file there are multiple records where membermiddlename is “”. In these cases , we need the id to be MEMBER
%memberID%.
For Eg : One record is having memebermiddlename =“anything” and memberId=123 , so here the id should be MEMBER_anything_123.
another record is having memebermiddlename ="" and memberId=234, so here the id should be MEMBER_234 .
How to go about this?