saveText#
- swordfish.function.saveText()#
Save DolphinDB variables or data queried by SQL statement as a text file on disk. Compared with saveTable, saveText requires more disk space and time.
- Parameters:
obj (Constant) – Can be a table/matrix/vector/metacode of SQL statements. When obj is the metacode of SQL statements, multiple workers are allocated to read the data concurrently, and the data is written to the file with another worker. In other cases, data queries and writes are handled by the current worker.
filename (Constant) – A string indicating the absolute path and name of the output file. Currently the output file can only be saved in .csv format.
delimiter (Constant, optional) – The table column separator. The system uses comma as the default delimiter, by default DFLT.
append (Constant, optional) – A Boolean value indicating whether to append to (true) or overwrite (false) the output file if it exists already, by default DFLT.
header (Constant, optional) – A BOOLEAN indicating whether to save the column names in the output file when obj is a table, by default DFLT.
bom (Constant, optional) – A case-insensitive STRING scalar that determines whether to include Byte order mark (BOM) in output CSV files. Currently, only “UTF-8” is supported, by default DFLT