csvdata

csvdata

Functions

Types and Values

enum AggrType
#define NON_NUMERIC

Description

Functions

import_na_init ()

void
import_na_init (void);

import_na_string ()

int
import_na_string (const char *s);

import_obs_label ()

int
import_obs_label (const char *s);

test_markers_for_dates ()

int
test_markers_for_dates (DATASET *dset,
                        int *reversed,
                        char *skipstr,
                        PRN *prn);

non_numeric_check ()

int
non_numeric_check (DATASET *dset,
                   int **plist,
                   gretl_string_table **pst,
                   PRN *prn);

reverse_data ()

void
reverse_data (DATASET *dset,
              PRN *prn);

gretl_join_data ()

int
gretl_join_data (const char *fname,
                 const char **vnames,
                 int nvars,
                 DATASET *dset,
                 const int *ikeyvars,
                 const char *okey,
                 const char *filter,
                 const char *dataname,
                 AggrType agg,
                 int seqval,
                 const char *auxname,
                 const char *tconvstr,
                 const char *tconvfmt,
                 gretlopt opt,
                 PRN *prn);

Opens a delimited text data file or gdt file and carries out a "join" operation to pull data into the current working dataset.

Parameters

fname

name of data file.

 

vnames

name(s) of variables to create or modify.

 

nvars

the number of elements in vnames .

 

dset

pointer to dataset.

 

ikeyvars

list of 1 or 2 "inner" key variables, or NULL.

 

okey

string specifying "outer" key(s) or NULL.

 

filtstr

string specifying filter, or NULL.

 

data

name of outer "payload" column, or NULL.

 

aggr

aggregation method specifier.

 

seqval

1-based sequence number for aggregation, or 0.

 

auxname

name of auxiliary column for max or min aggregation, or NULL.

 

tconvstr

string specifying date columns for conversion, or NULL.

 

tconvfmt

string giving format(s) for "timeconv" columns, or NULL.

 

opt

may contain OPT_V for verbose operation, OPT_H to assume no header row.

 

prn

gretl printing struct (or NULL).

 

Returns

0 on successful completion, non-zero otherwise.


probe_csv ()

int
probe_csv (const char *fname,
           char ***varnames,
           int *nvars,
           gretlopt *opt);

Open a Comma-Separated Values data file and read enough to determine the variable names.

Parameters

fname

name of CSV file.

 

varnames

location to receive variable names.

 

nvars

location to receive number of variables (columns).

 

opt

on input, may contain any extra options to pass to real_import_csv(); on return, OPT_H may be added if it seems to be required (no header).

 

Returns

0 on successful completion, non-zero otherwise.


normalize_join_colname ()

void
normalize_join_colname (char *targ,
                        const char *src,
                        int k);

csv_open_needs_matrix ()

int
csv_open_needs_matrix (gretlopt opt);

Types and Values

enum AggrType

Members

AGGR_NONE

   

AGGR_COUNT

   

AGGR_AVG

   

AGGR_SUM

   

AGGR_MIN

   

AGGR_MAX

   

AGGR_SEQ

   

NON_NUMERIC

#define NON_NUMERIC 1.0e99