Skip to content

TSTool / Command Reference / Overview

This reference section of the documentation provides information about TSTool commands, listed in groups consistent with the TSTool software menus. If necessary, use the documentation Search tool or the Find tool for the web browser to find a specific command or topic. The commands in the Reference - Commands section in the table of comments are listed alphabetically with several general commands including TSID listed at the top.

Command Syntax Overview

TSTool command files contain a list of commands, one command per line. These commands are processed in sequence from top to bottom. For and If control commands, if present, will cause execution order to jump over commands.

Each command adheres to the syntax:


The following are guidelines for commands:

  1. Commands always follow the convention of command name at start with a list of named parameters in parentheses. The only exceptions are:
    1. Comments starting with #.
    2. Block comments /* and */ that surround one or more command lines.
    3. Command such as Exit, which will always have empty list of parameters in the parentheses.
  2. Commands are generally not case-specific although the TSTool software enforces standards.
  3. Command and parameter names use mixed case where the first letter of each word is capitalized.
  4. Parameter values may optionally be surrounded by double quotes, regardless of type. Double quotes are required in some cases to protect spaces and other characters within quotes.
  5. Each command must exist on a single line.
  6. Spaces at the front of a command for indentation are currently not allowed. This limitation is planned to be removed in the future. Tabs used for indentation are discouraged and will likely be prohibited because tab width is ambiguous between different users and tools. Spaces will be the preferred method of indentation.
  7. Empty (blank) lines are allowed and will be handled as Empty commands.
  8. Unknown commands are handled as UnknownCommand commands.

Time Series Processing

Time series processing commands focus on time series, although other outputs such as tables and files may result from processing. Older commands assumed that only time series would be processed and have general names (e.g., Copy), whereas newer commands recognize that other objects may be processed and have more specific names (e.g., SelectTimeSeries).

Select, Free, Sort Time Series

These commands select, free, and sort time series.

Create Time Series

These commands create new time series from other time series or data values.

Read Time Series

These commands read time series from various sources.

Fill Time Series Missing Data

These commands fill missing time series values.

Set Time Series Contents

These commands set time series contents, including properties and data values.

Manipulate Time Series

These commands perform basic time series manipulation.

Analyze Time Series

These commands analyze time series.

Models - Routing

These commands route flow time series from one location to another.

Output Time Series

These commands output time series to different formats.

Check Time Series

These commands are used to check time series, for example for quality control.

Topic Area Commands

The following commands are grouped into specific topic areas.

Datastore Processing

These commands handle reading and writing time series and other data from datastores, in particular databases. Utility commands for executing SQL and creating a data dictionary are also provided.

Ensemble Processing

Network Processing

Spatial Processing

Spreadsheet Processing

Template Processing

Visualization Processing

General Commands

General commands perform tasks that are general in nature, meaning they are not specific to processing time series, tables, or other specific data types.

General - Comments

These commands are used to insert comments into command files.

General - File Handling

These commands provide general file handling capabilities.

General - Logging and Messaging

These commands handle run-time configuration of logging and sending messages.

General - Running and Properties

These commands provide general capabilities to control running commands, including running programs external to TSTool, handling processor properties (used with ${Property}), and control commands such as For and If.

General - Test Processing

These commands are used to run automated tests, in particular when running the full suite of tests.

Deprecated Commands

"Deprecated" commands are obsolete and have typically been replaced by other commands. These commands are generally quite old and may be removed at some point.

Table Commands

Table commands are used to process tabular data, for example:

  • database tables
  • Excel worksheets
  • delimited and other data files

Tables are converted to an in-memory representation where each column stores a single data type. Tables and time series can be converted back and forth, as needed.

Create, Copy, Free Table

These commands create, copy, and free tables.

Read Table

These commands read tables from various sources.

Append, Join Tables

These commands append and join tables.

Table, Time Series Processing

These commands convert between tables and time series.

Manipulate Tables

These commands manipulate tables.

Analyze Table

These commands analyze tables.

  • CompareTables - compare tables to detect whether they are the same or different

Output Table

These commands write tables to various formats.

Running and Properties

These commands handle table properties, which are used to control run logic.

Plugin Commands

Plugin commands are an experimental TSTool feature, designed to allow commands to be added to TSTool independent of the main TSTool distribution. This will allow third parties to add custom commands to TSTool.

Command List

The following table contains every command and provides summary information that is useful to software users and developers. Columns are as follows:

  • Command - command name as link to that command's documentation
  • Description - brief description
  • Doc - all documentation exists and has been migrated to the online version except for the indicated commands (blank indicates has been migrated)
  • Def. to Rel. Path - does command editor default to relative path (this feature has been prototyped but not implemented for all commands)?
Command                                                       Description Doc Def. to Rel. Path
# comment Single line comment.
\* comment block start Start of multi-line comment block.
\* comment block end End of multi-line comment block.
Add Add time series to time series.
AddConstant Add a constant to time series values.
AdjustExtremes Adjust extreme values in time series.
AnalyzeNetworkPointFlow Perform point flow analysis for a network.
AnalyzePattern Analyze pattern of time series data.
AppendFile Append a file to another file.
AppendTable Append a table to another table.
ARMA Autoregressive moving average.
Blend Blend one time series into another.
Break Break out of For command loop.
CalculateTimeSeriesStatistic Calculate a single-value statistic for a time series.
ChangeInterval Change time series interval.
ChangePeriod Change time series data period.
ChangeTimeZone Change the time zone for time series.
CheckTimeSeries Check time series values against criteria.
CheckTimeSeriesStatistic Check time series statistic against criteria.
CloseDataStore Close an open datastore.
CloseExcelWorkbook Close Excel workbook that is open.
CompareFiles Compare files to detect whether they are the same or different.
CompareTables Compare tables to detect whether they are the same or different.
CompareTimeSeries Compare time series to detect whether they are the same or different.
ComputeErrorTimeSeries Compute the error between two time series.
ConfigureLogging Configure logging.
Continue Jump to end of For command loop.
ConvertDataUnits Convert time series data units.
Copy Copy a time series.
CopyEnsemble Copy an ensemble to a new ensemble.
CopyFile Copy a file to another name.
CopyPropertiesToTable - documentation does not exist Command is under development. X
CopyTable Copy a table to a new table.
CopyTimeSeriesPropertiesToTable Copy time series properties to a table.
CreateDataStoreDataDictionary Create a database data dictionary.
CreateEnsembleFromOneTimeSeries Create an ensemble from a time series.
CreateFromList Create time series from a list in a file.
CreateNetworkFromTable Create a network from a table.
CreateRegressionTestCommandFile Create regression test suite command file.
CreateTimeSeriesEventTable Create an event table associated with time series.
Cumulate Set time series values to cumulative values.
DeleteDataStoreTableRows Delete datastore table rows.
DeleteTableColumns Delete columns from a table.
DeleteTableRows Delete rows from a table.
Delta Create a new time series from delta between time series values.
DeselectTimeSeries Deselect output time series for processing.
Disaggregate Create a new time series by disaggregating a time series.
Divide Divide one time series by another.
Empty Empty (blank) commands line.
EndFor End of For loop.
EndIf End of If loop.
Exit Stop processing commands.
ExpandTemplateFile Expand template file into full file.
FillCarryForward Replaced by FillRepeat.
FillConstant Fill missing time series values with a constant.
FillDayTSFrom2MonthTSAnd1DayTS Fill a daily time series by prorating monthly volumes using a daily pattern.
FillFromTS Fill missing time series values from another time series.
FillHistMonthAverage Fill missing time series values with historical monthly average.
FillHistYearAverage Fill missing time series values with historical yearly average.
FillInterpolate Fill missing time series values using interpolation.
FillMixedStation Fill missing time series values using mixed station approach.
FillMOVE1 Fill missing time series values using MOVE.1.
FillMOVE2 Fill missing time series values using MOVE.2.
FillPattern Fill missing time series values using historical pattern average.
FillPrincipalComponentAnalysis Fill missing time series using Principal Component Analysis.
FillProrate Fill missing time series values by prorating another time series.
FillRegression Fill missing time series values using regression.
FillRepeat Fill missing time series values by repeating values.
FillUsingDiversionComments Fill missing time series values using HydroBase diversion comments.
For Iterate over items in a loop.
FormatDateTimeProperty Format a date/time processor property.
FormatStringProperty Format string processor property.
FormatTableDateTime Format a date/time in a table.
FormatTableString Format a string in a table.
Free Free memory used by time series.
FreeTable Free memory resources for a table.
FTPGet Download a file from an FTP site.
If Test a condition to control logic flow.
InsertTableColumn Insert a column in a table.
InsertTableRow Insert a row in a table.
InsertTimeSeriesIntoEnsemble Insert a time series into an ensemble.
JoinTables Join two tables.
LagK Lag and attenuate flows.
ListFiles List files in a folder.
LookupTimeSeriesFromTable Create a time series by looking up data values from a table.
ManipulateTableString Manipulate a string in a table.
Message Output a message to the log file.
Multiply Multiply one time series by another.
NewDayTSFromMonthAndDayTS Create a new daily time series by distributing a monthly time series using a daily pattern.
NewDerbyDatabase - command is being developed X
NewSQLiteDatabase Create a new SQLite database.
NewEndOfMonthTSFromDayTS Create a new end of month time series from daily time series.
NewEnsemble Create a new time series ensemble.
NewExcelWorkbook Create a new Excel workbook file.
NewPatternTimeSeries Create a new time series with repeating pattern for data values.
NewStatisticMonthTimeSeries Create a new time series with monthly statistics.
NewStatisticEnsemble Create an ensemble of static time series.
NewStatisticTimeSeries Create a new time series having statistic repeated each year.
NewStatisticTimeSeriesFromEnsemble Create a new time series computed as statistic from an ensemble.
NewStatisticYearTS Create a new time series of annual statistics.
NewTable Create a new table.
NewTimeSeries Create a new time series.
NewTreeView Create a tree view in the user interface.
Normalize Create new time series by normalizing a time series.
OpenCheckFile - command is not enabled Open a check file for error handling. X
OpenDataStore Open a datastore.
OpenHydroBase Open a HydroBase database connection.
PrintTextFile Print text file to a printer.
ProcessRasterGraph Process (create) time series raster graph.
ProcessTSProduct Process (create) time series data product.
ProfileCommands Create summary table with containing performance data
ReadColoradoHydroBaseRest Read time series from State of Colorado HydroBase REST web services
ReadDateValue Read time series from a DateValue file.
ReadDelftFewsPiXml Read time series from Delft FEWS PI XML file.
ReadDelimitedFile Read time series from delimited file.
ReadExcelWorkbook Read Excel workbook file.
ReadHecDss Read time series from HEC-DSS file
ReadHydroBase Read time series from State of Colorado HydroBase database
ReadMODSIM Read time series from MODSIM model file.
ReadNrcsAwdb Read time series from NRCS AWDB web services
ReadNwsCard Read time series from NWS Card file
ReadNwsrfsEspTraceEnsemble Read time series from NWSRFS ESP trace ensemble file
ReadNwsrfsFS5Files Read time series from NWSRFS FS5 Files
ReadPatternFile Read time series used by ReadPatternFile
ReadPropertiesFromExcel Read processor properties from Excel.
ReadPropertiesFromFile Read processor properties from a file.
ReadRccAcis Read time series from RCC ACIS web service.
ReadReclamationHDB Read time series from Reclamation HDB database
ReadReclamationPisces Read time series from Reclamation Pisces database
ReadRiverWare Read time series from RiverWare file
ReadStateCU Read time series from a StateCU file.
ReadStateCUB Read time series from a StateCU binary file.
ReadStateMod Read time series from a StateMod file.
ReadStateModB Read time series from a StateMod binary file.
ReadTableCellsFromExcel Read table cells from Excel worksheet.
ReadTableFromDataStore Read a table from a datastore.
ReadTableFromDBF Read a table from a DBF file.
ReadTableFromDelimitedFile Read a table from a delimited file.
ReadTableFromExcel Read a table from an Excel workbook file.
ReadTableFromFixedFormatFile Read a table from a fixed-format file.
ReadTableFromJSON Read a table from a JSON file.
ReadTableFromXml Read a table from an XML file.
ReadTimeSeries Read a single time series using TSID to determine data source.
ReadTimeSeriesFromDataStore Read time series from a datastore.
ReadTimeSeriesList Read time series from a list in a table.
ReadUsgsNwisDaily Read daily value time series from USGS NWIS Daily web services
ReadUsgsNwisGroundwater Read groundwater time series from USGS NWIS Groundwater web services
ReadUsgsNwisInstantaneous Read instantaneous value time series from USGS NWIS Instantaneous web services
ReadWaterML Read time series from WaterML (1) file.
ReadWaterML2 Read time series from WaterML 2 file.
ReadWaterOneFlow Read time series from WaterOneFlow web service.
ReadUsgsNwisRdb Read time series from a USGS NWS RDB file
RelativeDiff Create a new time series as relative difference of two time series.
RemoveFile Remove a file.
ReplaceValue Replace values in time series data.
ResequenceTimeSeriesData Resequence time series data values by year.
RunCommands Run a TSTool command file.
RunningAverage Replaced by RunningStatisticTimeSeries
RunningStatisticTimeSeries Create time series containing statistic from moving "running" sample.
RunProgram Run a program.
RunPython Run a Python program.
RunR Run an R script.
RunSql Run an SQL statement on a datastore.
Scale Scale time series values.
SelectTimeSeries Select output time series for processing.
SendEmailMessage Send an email message.
SetAutoExtendPeriod Set global property to auto-extend time series to output period.
SetAveragePeriod Set the global period used to compute historical averages.
SetConstant Set time series data values to a constant.
SetConstantBefore Replaced by SetConstant
SetDataValue Set data values in time series.
SetDebugLevel Set the debug level for logging.
SetEnsembleProperty Set an ensemble property.
SetExcelCell Set data in an Excel cell.
SetExcelWorksheetViewProperties Set Excel worksheet view properties.
SetFromTS Set time series data values from another time series.
SetIgnoreLEZero Set global property to ignore time series values <=0 in averages.
SetIncludeMissingTS Set the global property to include missing time series in output.
SetInputPeriod Set the global processor input period.
SetOutputPeriod Set the global processor output period.
SetOutputYearType Set the global processor output year type.
SetPatternFile Replaced by ReadPatternFile command
SetProperty Set processor property value.
SetPropertyFromNwsrfsAppDefault - being phased out X
SetPropertyFromEnsemble Set processor property from ensemble.
SetPropertyFromTable Set processor property from a table.
SetPropertyFromTimeSeries Set processor property from time series property.
SetTableValues Set values in a table.
SetTimeSeriesPropertiesFromTable Set time series properties from table values.
SetTimeSeriesProperty Set a time series property.
SetTimeSeriesValuesFromLookupTable Set time series values from a lookup table.
SetTimeSeriesValuesFromTable Set time series values from a table.
SetToMax Set time series values to maximum of 1+ time series.
SetToMin Set time series values to minimum of 1+ time series.
SetWarningLevel Set the warning level for logging.
SetWorkingDir Set the working directory (folder) for following commands.
ShiftTimeByInterval Shift time series data values by a time interval.
SortTable Sort table contents.
SortTimeSeries Sort the output time series.
SplitTableColumn Split a table column into multiple columns.
SplitTableRow Split a table row into multiple rows.
StartLog (Re)start the log file.
StartRegressionTestResultsReport Start the regression test results report file to record output of tests.
StateModMax Create time series that are maximum of two StateMod files.
Subtract Subtract time series from time series.
TableMath Perform simple math on table columns.
TableTimeSeriesMath Perform simple math on a table and time series.
TableToTimeSeries Create time series from a table.
TimeSeriesToTable Copy time series to a table.
TSID Time series identifier (TSID), causes time series to be read.
UnknownCommand Unknown command.
UnzipFile Unzip the contents of a zip file.
VariableLagK Lag and attenuate flows.
Wait Wait for at time before continuing.
WebGet Download a file from a URL.
WeightTraces Create time series as weighted sum of ensemble traces.
WriteCheckFile Write command log to file.
WriteCommandSummaryToFile Write summary of command log to a file.
WriteDateValue Write time series to DateValue format file.
WriteDelftFewsPiXml Write time series to a Delft FEWS PI XML file.
WriteDelimitedFile Write time series from delimited file.
WriteHecDss Write time series to a HEC-DSS file.
WriteNwsCard Write time series to a NWS Card file.
WriteNwsrfsEspTraceEnsemble Write time series ensemble to NWSRFS ESP trace ensemble file.
WritePropertiesToFile Write processor properties to a file.
WriteReclamationHDB Write time series to Reclamation HDB database
WriteRiverWare Write time series to a RiverWare file.
WriteSHEF Write time series to SHEF file.
WriteStateCU Write time series to a StateCU file.
WriteStateMod Write time series to a StateMod file.
WriteSummary Write time series to a summary report file.
WriteTableCellsToExcel Write table row cells to an Excel worksheet.
WriteTableToDataStore Write a table to a datastore.
WriteTableToDelimitedFile Write a table to delimited file.
WriteTableToExcel Write a table to an Excel workbook file.
WriteTableToGeoJSON Write a table to a GeoJSON file.
WriteTableToHTML Write a table to an HTML file.
WriteTableToKml Write a table to a KML file.
WriteTableToShapefile Write a table to a shapefile.
WriteTimeSeriesPropertiesToFile Write time series properties to a file.
WriteTimeSeriesToDataStore Write time series to a datastore.
WriteTimeSeriesToDataStream Write time series to a stream of data lines.
WriteTimeSeriesToExcel Write time series to an Excel workbook.
WriteTimeSeriesToExcelBlock Write time series to an Excel workbook using block format.
WriteTimeSeriesToGeoJSON Write time series to a GeoJSON file.
WriteTimeSeriesToHydroJSON Write time series to a HydroJSON file.
WriteTimeSeriesToJson Write time series to a JSON file.
WriteTimeSeriesToKml Write time series to a KML file.
WriteWaterML Write time series to WaterML 1 file.
WriteWaterML2 Write time series to WaterML 2 file