|
TPCCLIB
|
CSV file i/o functions. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <stdlib.h>#include <math.h>#include <time.h>#include <string.h>#include "tpccsv.h"Go to the source code of this file.
Functions | |
| int | csvList (CSV *csv, FILE *fp) |
| int | csvWrite (CSV *csv, int regular, FILE *fp, TPCSTATUS *status) |
| int | csvRead (CSV *csv, FILE *fp, TPCSTATUS *status) |
| int | csvPutLine (CSV *csv, const char *line, TPCSTATUS *status) |
| int | csvPutLineWithSpaces (CSV *csv, const char *line, TPCSTATUS *status) |
| int | csvCleanSpaces (CSV *csv) |
| int csvCleanSpaces | ( | CSV * | csv | ) |
Removes any initial and trailing space characters from CSV. Space characters in the middle of the string are not removed.
| csv | Pointer to CSV, the content of which is to be cleaned. |
Definition at line 422 of file csvio.c.
Referenced by parReadCSV().
| int csvList | ( | CSV * | csv, |
| FILE * | fp ) |
Write CSV data as a tab separated list into file opened for writing. List contains the cell rows, columns, and values.
Data is not sorted, and cell contents are written as they are, that is, no conversions for decimal separator is done here.
| csv | Pointer to CSV structure, contents of which are to be written. |
| fp | Output file pointer; usually stdout. |
Definition at line 27 of file csvio.c.
Referenced by tacReadSIF().
Process a given text line (string) to add a new row of fields to CSV, using as field delimiter the character specified in CSV structure.
| csv | Pointer to initiated CSV; previous contents are not changed. |
| line | Pointer to the CSV file line to be processed. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 251 of file csvio.c.
Referenced by csvRead().
Process a given text line (string) to add a new row of fields to CSV, using spaces as field delimiters, independent on what is told in CSV struct.
| csv | Pointer to initiated CSV; previous contents are not changed. |
| line | Pointer to the CSV file line to be processed. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 351 of file csvio.c.
Referenced by csvRead().
Read CSV file contents into CSV structure, allocating memory as needed.
Lines consisting only of space characters, including tabs, are not read. Partial support for spaces as delimiters.
| csv | Pointer to CSV to read into; any previous contents of CSV are preserved. |
| fp | Input file pointer. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 124 of file csvio.c.
Referenced by parRead(), tacFormatDetermine(), and tacRead().
Write CSV data into file opened for writing, using the column separator specified inside CSV structure.
Field contents are written as they are, that is, no conversions for decimal separator is done here.
| csv | Pointer to CSV structure, contents of which are to be written. |
| regular | Forced regularization (1), or not (0); if regularized, then row_nr rows are written, each with col_nr columns; otherwise, empty rows are not written, and missing cells are not written to the end of rows. |
| fp | Output file pointer. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 52 of file csvio.c.
Referenced by parRead(), parReadFIT(), parReadRES(), parWriteCSV(), tacRead(), tacReadSimple(), and tacWriteCSV().