ResSimpy.Nexus.nexus_file_operations.get_expected_next_value
- ResSimpy.Nexus.nexus_file_operations.get_expected_next_value(start_line_index: int, file_as_list: list[str], search_string: str | None = None, ignore_values: list[str] | None = None, replace_with: str | VariableEntry | None = None, custom_message: str | None = None) str[source]
Gets the next non blank value in a list of lines.
- Parameters:
start_line_index (int) – line number to start reading file_as_list from
file_as_list (list[str]) – a list of strings containing each line of the file as a new entry
search_string (str) – string to search from within the first indexed line
ignore_values (Optional[list[str]], optional) – a list of values that should be ignored if found. Defaults to None.
replace_with (Union[str, VariableEntry, None], optional) – a value to replace the existing value with. Defaults to None.
Optional[str] (custom_message) – A custom error message if no value is found
- Returns:
str – Next non blank value from the list, if none found raises ValueError