A Simple Import View

Update this when I finish the view templates article. FIXME

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)

Automated Import View

Import views can also be automatically created out of Documenter. To do this:

  1. Select View Scripts → Import from the SAMM menu
  2. Activate the control checkbox (fixed variables cannot be changes and therefore are not relevant to import views)
  3. Click OK and then specify the location to save the .v and .t files.

Note: