User Tools

Site Tools


howtos:workwithdata:a_simple_import_view

This is an old revision of the document!


A Simple Import View

Mention that import views can be created out of documenter. FIXME

Update this when I finish the view templates article.

This simple view shows the import of three commonly used formats - tab-delimited text, comma-separated value (.csv) and the native tool format:

creview    emigration[s,ts1,a][]
creview    immigration[s,ts1,a][]
creview    mortality[s,ts1,a][]

integer $index
$index = 1
if $history == true
    $index = $index + 1
endif
if $background == true
    $index = $index + 1
endif

string $importDir
$importDir = $home + "/importData"

! default tab-delimited text file in odometer data format
emigration[s,ts1,a][$index] = import (; rowTitles=on, dataFile=$importDir/emigration.txt)

! comma delimited text file in coordinate data format
immigration[s,ts1,a][$index] = import (; format=coord, allCoord=off, delimiter=",", \
	dataFile=$importDir/immigration.csv)

! native TOOL format
mortality[s,ts1,a][$index] = import (; format=tool, dataFile=$importDir/mortality)
howtos/workwithdata/a_simple_import_view.1306958157.txt.gz · Last modified: 2011/06/01 19:55 by marcus.williams