<< getconfig Basic functions internet2sci >>

Grocer >> Basic functions > impexc2bd

impexc2bd

importation of a csv excel file

CALLING SEQUENCE

impexc2bd(filein,sep,fileout,arg1,...,argn)

PARAMETERS

Input

* filein = name of the file to be imported (between quotes)

* sep = separator used in the filein (between quotes)

* fileout = name of the scilab file where to save the imported data (between quotes)

* argi = optional arguments

  - 'namedat=xxx' where xxx is the name given to the field dates in the .csv file (default: dates)

  - 'namena=x1;x2;...xn' where xi are the values that the Non Available data can take in the .csv file ('default: ' ' and '#N/A')

  - 'prefix=xxx' where xxx is the prefix that will be added to the names of the variables in the .csv database to obtain their names in the Scilab .dat database

 

Output

* Nothing: the imported series are saved in the file named fileout

DESCRIPTION

Imports an excel file saved under csv format: this is at the very beginning an original scilab function, but improved to be more efficient and extended to deal with ts. By default, if one data is named dates or DATES (scilab distinguish capitals from small letters) then the following data are saved as timeseries. By default, if a value is lacking or #N/A in a timeseries, it is given a NA value. A prefix can be added to the name of each variable.

EXAMPLE

impexc2bd(GROCERDIR+'/data/bdhenderic.csv',';','c:/example/bdhenderic.dat')
// Provided that the folder 'c:/example/' exists on your computer, provides the importation of date in file data/bdhenderic.csv into the Scilab file 'c:/example/bdhenderic.dat'. The separator is here ' ;'.
 
impexc2bd(GROCERDIR+'/data/bdhenderic.csv',';','c:/example/bdhenderic.dat','namena=:; ','namedat=dates','prefix=uk_')
// Allows various options: NA can be blanks or ':'; the dates are labelled dates (equivalent here to the default option, but other names are possible); each variable in the database will be prefixed uk_ (giving uk_lm1, uk_lp, uk_ly, uk_rnet).

AUTHOR

Eric Dubois 2002-2007

Report an issue
<< getconfig Basic functions internet2sci >>