Source: factory.import/ObjDataImportFwf.py
API for importing data from Fixed-Width Format (FWF) files.
Column layout is supplied by setting self.field_specs before calling
open_file. Each entry is a tuple of (column_name, start, end) where
start and end are 0-based character positions (end is exclusive, matching
...
| Method | Signature | Description |
|---|---|---|
| prep_file | prep_file(filename: str) -> str |
No preparation needed for FWF files. |
| open_file | open_file(filename: str) -> None |
Opens the FWF file for streaming. If field_specs is set, column |
| close_file | close_file() -> None |
Closes the FWF file handle. |
| column_list | column_list() -> list | None |
Returns column names derived from field_specs. |
| next_row | next_row() -> list | str | None |
Reads the next non-empty line and slices it according to field_specs. |