diff --git a/nifi/user-scripts/anonymise_doc.py b/nifi/user-scripts/anonymise_doc.py index af028e40..6179e8b3 100644 --- a/nifi/user-scripts/anonymise_doc.py +++ b/nifi/user-scripts/anonymise_doc.py @@ -41,10 +41,10 @@ def special_deid(cat, text, record): text_field = record[text_field_name] _anon_text = "" if len(text_field) > char_limit: - sections = int(len(text_field_name) / char_limit) + sections = int(len(text_field) / char_limit) for i in range(sections): - _tmp_text = text_field[i * char_limit: (i + 1) * char_limit] + _tmp_text = text_field[i * char_limit:(i + 1) * char_limit] _anon_text += deid_text(cat, _tmp_text) else: _anon_text = deid_text(cat, text_field)