def import_from_txt(<EOL>filename_or_fobj, encoding="<STR_LIT:utf-8>", frame_style=FRAME_SENTINEL, *args, **kwargs<EOL>):
<EOL>source = Source.from_file(filename_or_fobj, mode="<STR_LIT:rb>", plugin_name="<STR_LIT>", encoding=encoding)<EOL>raw_contents = source.fobj.read().decode(encoding).rstrip("<STR_LIT:\n>")<EOL>if frame_style is FRAME_SENTINEL:<EOL><INDENT>frame_style = _guess_frame_style(raw_contents)<EOL><DEDENT>else:<EOL><INDENT>frame_style = _parse_frame_style(frame_style)<EOL><DEDENT>contents = raw_contents.splitlines()<EOL>del raw_contents<EOL>if frame_style != "<STR_LIT:None>":<EOL><INDENT>contents = contents[<NUM_LIT:1>:-<NUM_LIT:1>]<EOL>del contents[<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>if not contents[<NUM_LIT:1>].strip():<EOL><INDENT>del contents[<NUM_LIT:1>]<EOL><DEDENT><DEDENT>col_positions = _parse_col_positions(frame_style, contents[<NUM_LIT:0>])<EOL>table_rows = [<EOL>[<EOL>row[start + <NUM_LIT:1> : end].strip()<EOL>for start, end in zip(col_positions, col_positions[<NUM_LIT:1>:])<EOL>]<EOL>for row in contents<EOL>]<EOL>meta = {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT:source>": source,<EOL>"<STR_LIT>": frame_style,<EOL>}<EOL>return create_table(table_rows, meta=meta, *args, **kwargs)<EOL>
Return a rows.Table created from imported TXT file.