This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
howtos:workwithdata:export_quick_reference [2010/11/18 17:02] marcus.williams |
howtos:workwithdata:export_quick_reference [2013/01/31 16:52] (current) marcus.williams |
||
---|---|---|---|
Line 4: | Line 4: | ||
<code> | <code> | ||
- | string $exportDir= $home + "/exportData" | + | string $exportDir= $modelHome + "/exportData" |
</code> | </code> | ||
- | ===== csv format ===== | + | ===== csv coordinate format ===== |
This code exports a 2-dimensional population TOOL object (by age, by time) to a csv file with age in the rows and time in the columns. | This code exports a 2-dimensional population TOOL object (by age, by time) to a csv file with age in the rows and time in the columns. | ||
Line 14: | Line 14: | ||
heading=on, file=$exportDir/refPop.csv) | heading=on, file=$exportDir/refPop.csv) | ||
</code> | </code> | ||
+ | |||
+ | ===== tab delimited text odometer (block) format ===== | ||
+ | This format is useful for migrating data between models in a human-readable format, as opposed to binary //tool//-format files. Note the use of ''expForm'' and ''decimals'' parameters to preserve precision. | ||
+ | |||
+ | <code> | ||
+ | export (immigration[s,ts1,a]; dataFormat=odometer, fileFormat=text, \ | ||
+ | expForm=on, decimals=6, \ | ||
+ | file=$exportDir/immigration.txt) | ||
+ | </code> | ||
+ | |||
+ | produces the following (header not shown): | ||
+ | |||
+ | <file> | ||
+ | ! sex=male | ||
+ | ! 0 1 2 | ||
+ | "1977" 1.049407e+02 1.314661e+02 1.317941e+02 | ||
+ | "1978" 9.129648e+01 1.133035e+02 1.212180e+02 | ||
+ | "1979" 8.643492e+01 9.573391e+01 9.366822e+01 | ||
+ | "1980" 9.673356e+01 9.806976e+01 9.806976e+01 | ||
+ | </file> | ||
+ | |||
+ | See the [[howtos:workwithdata:import_quick_reference#tab_delimited_text_odometer_block_format|corresponding import call]]. | ||
===== TOOL format ===== | ===== TOOL format ===== |