shStudio creates a NPC with its type set to GateKeeper if it created in GK panel, it creates a merchant if the merchant panel is selected, and the selected (from combo-box) NPC type if the "other NPC" panel is selected. dot. that is still not the question.
the python script provides details regarding the error: "split" is not supported by "rec[ field_name ]".
it can be because that item (whose ident is stored in field_name) is not a string, and so is null or because field_name is not the identifier of an item of the rec array (meaning field_name is null).
the reasons of these 2 possibles errors are in the processed input file (if this several years old-script fails to process any data, this would have been already discussed), so the request is not "how to fix the script" but "what is wrong in my data" ... data you didn't provide ...
double-check and verify any edited records (lines) and make sure you didn't forget one item (and so one delimiter such as a comma) somewhere. optionally edit the script to output on the console the index of the processed line, that will help you.