Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
load_table [2013/09/26 20:29]
127.0.0.1 external edit
load_table [2026/08/28 03:25] (current)
hermann Sync from local documentation review
Line 1: Line 1:
-====== Load Table ====== ​+====== Load Table ======
  
 ===== Description ===== ===== Description =====
  
-This functor loads a table from a file. The file name and its path must be specified.+Loads a table from a file. The file format is determined automatically from the filename'​s extension.
  
 ===== Inputs ===== ===== Inputs =====
  
-^ Name ^ Type ^ Description ^ +^ Name  ^ Type  ^ Description ​ 
-| Filename ​ | [[Table Filename Type|Table Filename]]  | Name of the file that contains the table to be loadedDinamica automatically determines ​the file format from a selected file extension (only multi-column CSV comma separated ​value formatis accepted).  |+| Filename ​ | [[Table Filename Type]] ​ | Name and path of the file to loadIf no path is given, ​the file is located relative to the model script. Only multi-column CSV (comma-separated ​values) ​format is accepted. ​ | 
 ===== Optional Inputs ===== ===== Optional Inputs =====
  
-^ Name ^ Type ^ Description ^ Default Value ^ +^ Name  ^ Type  ^ Description ​ ^ Default Value  ^ 
-| Suffix Digits ​ | [[Non Negative ​Int Type|Non Negative Int  ​]]  | Number of digits used to represent the file name suffix. ​ | 0  | +| Unique Id Key Column Creation ​ | [[Enum Type]] ​ | Behavior for adding an auto-incrementing unique-id key column at the start of the loaded table. Possible values are If Necessary (add the column only when the file needs one), Do Not Create, and Always. This is an advanced port.  | If Necessary ​ | 
-step  | [[Non Negative ​Int Type|Non Negative Int  ​]]  | Current step or model iteration. Files with the same name and numbered suffixes will be loaded sequentially according ​to the model step.  | None  | +| Suffix Digits ​ | [[Non Negative ​Integer Value Type]] ​ | Number of digits used to render Step as a filename ​suffix. If Step needs more digits than this, it is used unmodified. If zero, no suffix is added. This is an advanced port.  | 0  | 
-| Workdir ​ | [[Workdir Type|Workdir]]  | Workdir ​folder ​path.  | None  |+Step  | [[Non Negative ​Integer Value Type]] ​ | Current step or model iteration, appended to Filename as a numeric suffix; automatically bound to the innermost compatible container. This is an advanced port.  | .none  | 
 +| Workdir ​ | [[Workdir Type]] ​ | Work directory Filename is relative to; may be a folder ​or a Zip archive. When not bound, the directory containing the script is used. This is an advanced port.  | .none  |
  
 ===== Outputs ===== ===== Outputs =====
  
-^ Name ^ Type ^ Description ^ +^ Name  ^ Type  ^ Description ​ 
-| Table  | [[Table Type|Table]] | The table loaded ​by the functor.  |+| Table  | [[Table Type]] ​ Table loaded ​from the file.  |
  
 ===== Group ===== ===== Group =====
  
-[[Functor List#​Input/​Output | Input/​Output]]+[[Functor List#Input / Output | Input / Output]]
  
 ===== Notes ===== ===== Notes =====
  
-It is possible to tables from [[wp>​zip_(file_format)|Zip]] archives. See [[useful_tips#​loading_files_from_zip_files|this useful tip]] to know how to do it. +Only the CSV (comma-separated values) file format is supported. 
-===== Internal Name ===== + 
 +If Step is .none, the loaded filename has no numeric suffix. 
 + 
 +It is possible to load tables from [[wp>​zip_(file_format)|Zip]] archives; Workdir may point directly to a Zip archive rather than a folder. See [[Useful Tips#​loading_files_from_zip_files|this useful tip]] to know how to do it. 
 + 
 +===== Internal Name =====
  
 LoadTable LoadTable