Spectre generate Options

The Spectre command line generate sub-command can generate files. It has the following syntax:

spectre generate <target type> [options]

The only available target type is a build file, which generates a build script. It has the following syntax:

spectre generate build <filename> [options]

The <filename> points to an existing data file. The <filename> can take various forms:

  • If you set DI_PROJECT or pass --project as an argument, you can use a project path such as /data/sales.txt. This format always uses forward slashes regardless of the operating system.
  • If you do not set DI_PROJECT and do not pass --project as an argument, you can use a file system path such as C:\di\project\sales\data\sales.txt, or use sales.txt if the current working directory is C:\di\project\sales\data.

For example:

spectre generate build /data/sales.txt

Enter spectre generate build -h to display the syntax and options as shown in the following table.

Spectre generate build Sub-command Options

Option Description
--dataroot arg

Set the path to the DiveLine server dataroot.

For example:

spectre generate build /data/sales.txt --dataroot c:\di\solution\dl-dataroot

Instead of using this option, you can set the DI_HOME environment variable. See Setting Environment Variables.

--project arg

Set the project name.

For example:

spectre generate build /data/sales.txt --project sales

Instead of using this option, you can set the DI_PROJECT environment variable. See Setting Environment Variables.

--encoding arg

Specify input encoding for text files.

For example:

spectre generate build /data/sales.txt --encoding ISO-8859-1

The resulting Build script includes the encoding= attribute.

-l [ --limit-rows ] arg

Limit the number of input rows. The default value is 100000.

For example:

spectre generate build /data/sales.txt --limit-rows 500

The Build script generated includes the limit-rows= attribute.

-d [ --delimiter ] arg

Set the field delimiter.

For example:

spectre generate build /data/sales.txt --delimiter ","

The generated Build script includes the delimiter= attribute.

NOTE: When no delimiter is specified, Spectre tries to determine the column delimiter on input text files. However, it does NOT cause the detected delimiter to be explicitly written into the generated Build script.

--no-headers

Do not treat the first row as a header row.
The resulting Build script includes the attribute headers=false.

--ignore-quotes

Do not strip quotes.
The resulting Build script includes the attribute quotes=false.

--no-trim

Do not trim white space around values.

The resulting Build script includes the attribute trim=false.

--script-path arg

Set the path for the generated Build script—be sure the folder exists in the project.

For example:

spectre generate build /data/sales.txt --script-path /build/sales.build

If not set, the output defaults to the same directory as the data.

--cbase-path arg

Set a path for the cBase.

For example:

spectre generate build /data/sales.txt --cbase-path /cbases/sales.cbase

If not set, the cBase is placed in the same directory as the Build script.

-q [ --quiet ]

Print only warnings and errors to the console.

For example:

spectre generate build /data/sales.txt --quiet

When the command runs with this option, no timestamps or individual processes display; only warnings and errors are output to the console. If successful, only the command prompt displays.