diff --git a/sasdata/ascii_reader_metadata.py b/sasdata/ascii_reader_metadata.py index 8be986b..01930f6 100644 --- a/sasdata/ascii_reader_metadata.py +++ b/sasdata/ascii_reader_metadata.py @@ -46,6 +46,10 @@ class AsciiReaderMetadata: filename_separator: dict[str, str | bool] = field(default_factory=dict) master_metadata: dict[str, AsciiMetadataCategory[int]] = field(default_factory=default_categories) + def init_separator(self, filename: str): + separator = next(filter(lambda c: c in SEPARATOR_PRECEDENCE, filename), True) + self.filename_separator[filename] = separator + def filename_components(self, filename: str, cut_off_extension: bool = True, capture: bool = False) -> list[str]: separator = self.filename_separator[filename] # FIXME: This sort of string construction may be an issue. Might need an alternative.