ResSimpy.Nexus.nexus_file_operations.get_previous_value

ResSimpy.Nexus.nexus_file_operations.get_previous_value(file_as_list: list[str], search_before: str | None = None, ignore_values: list[str] | None = None) str | None[source]

Gets the previous non blank value in a list of lines. Starts from the last line working backwards.

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

  • from. (ending with the line to start searching) –

  • search_before (Optional[str]) – The string to start the search from in a backwards direction

  • ignore_values (Optional[list[str]], optional) – a list of values that should be ignored if found. Defaults to None.

Returns:

Optional[str] – Next non blank value from the list, if none found returns None