ResSimpy.Nexus.nexus_file_operations.strip_file_of_comments

ResSimpy.Nexus.nexus_file_operations.strip_file_of_comments(file_as_list: list[str], strip_str: bool = False) list[str][source]

Strips all of the inline, single and multi line comments out of a file. Comment characters assumed are: ! and square brackets. Escaped characters are ones wrapped in quotation marks.

Parameters:
  • file_as_list (list[str]) – a list of strings containing each line of the file as a new entry

  • strip_str (bool, optional) – if True strips the lines of whitespace. Defaults to False.

Returns:

list[str] – a list of strings containing each line of the file as a new entry without comments