def __import_csv(self):
<EOL>import sys<EOL>import csv<EOL>with open(self.csv_file, '<STR_LIT:r>') as f:<EOL><INDENT>has_auxiliary_text = False<EOL>reader = csv.reader(f)<EOL>for row in reader:<EOL><INDENT>if len(row) == <NUM_LIT:2>:<EOL><INDENT>translation_type_tag = None<EOL>auxiliary_translation_type_tag = None<EOL>has_auxiliary_text = False<EOL>types_list = row[<NUM_LIT:0>].split("<STR_LIT:e>")<EOL>translation_type_tag = types_list[<NUM_LIT:0>].strip()<EOL>if len(types_list) == <NUM_LIT:2>:<EOL><INDENT>auxiliary_translation_type_tag = types_list[<NUM_LIT:1>].strip()<EOL>has_auxiliary_text = True<EOL><DEDENT>self.__create_record("<STR_LIT>",<EOL>**{'<STR_LIT>': translation_type_tag,<EOL>'<STR_LIT:name>': translation_type_tag,<EOL>'<STR_LIT>': has_auxiliary_text,<EOL>'<STR_LIT>': auxiliary_translation_type_tag,<EOL>'<STR_LIT>': translation_type_tag,<EOL>'<STR_LIT>': translation_type_tag})<EOL><DEDENT>else:<EOL><INDENT>if "<STR_LIT>" not in row[<NUM_LIT:0>] and len(row) > <NUM_LIT:1>:<EOL><INDENT>if len(row) == <NUM_LIT:5>:<EOL><INDENT>params_dict = {<EOL>'<STR_LIT:type>': re.sub(r"<STR_LIT>", '<STR_LIT>', row[<NUM_LIT:0>]),<EOL>'<STR_LIT>': row[<NUM_LIT:0>],<EOL>'<STR_LIT:text>': row[<NUM_LIT:1>],<EOL>'<STR_LIT>': row[<NUM_LIT:1>],<EOL>'<STR_LIT>': row[<NUM_LIT:2>],<EOL>}<EOL><DEDENT>else:<EOL><INDENT>params_dict = {<EOL>'<STR_LIT:type>': re.sub(r"<STR_LIT>", '<STR_LIT>', row[<NUM_LIT:0>]),<EOL>'<STR_LIT>': row[<NUM_LIT:0>],<EOL>'<STR_LIT:text>': row[<NUM_LIT:2>],<EOL>'<STR_LIT>': row[<NUM_LIT:2>],<EOL>'<STR_LIT>': row[<NUM_LIT:3>],<EOL>}<EOL>if has_auxiliary_text:<EOL><INDENT>params_dict.update({<EOL>'<STR_LIT>': row[<NUM_LIT:1>],<EOL>'<STR_LIT>': row[<NUM_LIT:4>],<EOL>'<STR_LIT>': row[<NUM_LIT:4>],<EOL>'<STR_LIT>': row[<NUM_LIT:5>]<EOL>})<EOL><DEDENT><DEDENT>self.__create_record("<STR_LIT>", **params_dict)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
file format:
header
Código WMLB|Código WMHT|WMLB EN|WMLB PT|WMHT EN|WMHT PT|Nome do Campo|Tipo do Campo|Contexto|Local de Uso
primary_tag|auxiliary_tag|text_en|text_pt_br|auxiliary_text_en|auxiliary_text_pt_br|Nome do Campo|Tipo do Campo|Contexto|Local de Uso
0|1|2|3|4|5|6|7|8|9