dmlfw (Daniyal Machine Learning Framework)

Functions for CSV file dimensions and inspection. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

uint64_t dmlfw_get_csv_columns_count (const char *csv_file_name)
 Counts the number of columns in a CSV file.
 
void dmlfw_get_csv_dimensions (const char *csv_file_name, uint64_t *rows, uint64_t *columns)
 Retrieves both the row and column counts of a CSV file.
 
uint64_t dmlfw_get_csv_rows_count (const char *csv_file_name)
 Counts the number of rows in a CSV file.
 

Detailed Description

Functions for CSV file dimensions and inspection.

Version
1.0
Date
2025-09-25

This header provides functions to retrieve dimension information from CSV files, such as the number of rows, columns, and both dimensions together.

Error Handling:

Functions set error status on failure using the centralized error API. Use dmlfw_error() to check error status after calls. Use dmlfw_get_error_string() and dmlfw_get_debug_string() for details.

Function Documentation

◆ dmlfw_get_csv_columns_count()

uint64_t dmlfw_get_csv_columns_count ( const char *  csv_file_name)

Counts the number of columns in a CSV file.

Determines the number of columns in the first data row (or header).

Parameters
csv_file_name[in] Path to the CSV file to be analyzed.
Returns
Number of columns in the CSV file, or 0 on failure (check error).
Examples
example_dmlfw_utils_file.c.

◆ dmlfw_get_csv_dimensions()

void dmlfw_get_csv_dimensions ( const char *  csv_file_name,
uint64_t *  rows,
uint64_t *  columns 
)

Retrieves both the row and column counts of a CSV file.

Reads the CSV file and fills in the number of rows and columns.

Parameters
csv_file_name[in] Path to the CSV file.
rows[out] Pointer to store the number of rows.
columns[out] Pointer to store the number of columns.
Examples
example_dmlfw_utils_file.c.

◆ dmlfw_get_csv_rows_count()

uint64_t dmlfw_get_csv_rows_count ( const char *  csv_file_name)

Counts the number of rows in a CSV file.

Counts all lines except possibly header depending on implementation.

Parameters
csv_file_name[in] Path to the CSV file to be analyzed.
Returns
Number of rows in the CSV file, or 0 on failure (check error).
Examples
example_dmlfw_utils_file.c.