cratepy.ioput.readprocedures.searchoptkeywordline

searchoptkeywordline(file, keyword)[source]

Search optional keyword in data file and get corresponding line number.

Parameters:
  • file (file) – Data file.

  • keyword (str) – Keyword.

Returns:

  • is_found (bool) – True if keyword is found in data file, False otherwise.

  • line_number (int) – Number of data file line where the keyword is first found. Set to 0 by default if keyword is not found.