Target file: $1
- If
$1is empty, state that a file path is required and stop. - Run
wc -l "$1"to get the line count.- If the file cannot be read or does not look like valid CSV (no consistent delimiter across lines — check with
head -5 "$1"), say so plainly and stop. - If under ~5000 lines, read the file directly with Read and parse it.
- Otherwise, compute stats with a
python3 -c "..."one-liner using the standardcsvmodule (do not use pandas, do not load all rows into memory/conversation).
- If the file cannot be read or does not look like valid CSV (no consistent delimiter across lines — check with
- Compute and report:
- Total row count (excluding header)
- Column names
- Inferred type per column (numeric / text / date / boolean), best-effort from a sample of values
- Null/empty-value count per column
- For numeric columns: min, max, mean
- For columns with under ~20 distinct values: value counts
- Present the report as a compact table/list. Do not dump raw row data.