Model.tablepopulate#
- Model.tablepopulate(name, filename, delimiter)#
Populates an existing table with data from a delimited file. The data in the file must match the format of the columns defined in the table. Additional rows are appended to the table and existing data remains.
- Parameters:
name (hwString) – The name of the table to populate. The table will be overwritten with the data from the file.
filename (hwString) – The full path and filename of the file to use to populate the table.
delimiter (hwString) – The character or string to use as the delimiter. The value must be enclosed in quotes. If not specified, the default is a comma (CSV).
Examples#
Populate “ table1 “ with “ C:/table1.csv “ , which is a comma delimited file#import hm import hm.entities as ent model = hm.Model() model.tablepopulate(name="table1",filename="C:/table1.csv",delimiter=",")
Populate “ table1 “ with “ C:/table1.csv “ , which is a comma delimited file ( Alternatively )#import hm import hm.entities as ent model = hm.Model() model.tablepopulate(name="table1",filename="C:/table1.csv",delimiter="")
Populate “ table1 “ with “ C:/table1.txt “ , which is a space delimited file#import hm import hm.entities as ent model = hm.Model() model.tablepopulate(name="table1",filename="C:/table1.csv",delimiter=" ")