Detailed Method Reference

Namespace: Canley.Utility.CSV
Class: CanleyCSVReader

Validate

public bool Validate(out string report)
  • Description: Performs a deep structural check. It ensures every row matches the column count of the header (Row 0).

  • Workflow:

    1. Baseline Establishment: Records the length of Row 0 to use as the requirement for all subsequent rows.
    2. Iterative Audit: Loops through the entire grid, comparing each row’s length to the baseline.
    3. Report Generation: Appends specific row indices and discrepancy details to the report string if a mismatch is found.
  • Parameters:

    • report: An out string containing a detailed row-by-row error report.
  • Returns: bool (True if the file is perfectly consistent).

  • Example:

if (!csvManager.Reader.Validate(out string report))
{
    Debug.LogWarning("CSV Structure Error: " + report);
}