Parser Options

Parser Options

/asIs

Use this option to disable any special processing of the input data like converting Yahoo Finance timestamps to datetime values.

/attributedColumns=<col>.<attr>[;...]

Use this option to create output columns from XML attribute values.

For example, Zoho CRM exports data like

<FL val="FirstName">John</FL>
<FL val="LastName">Doe</FL>

To extract values into the FirstName and LastName columns use the following option:

/attributedColumns=FL.val

/collapsedNodes=<node>[;...]

Use this option to include XML child node values into the parent node.

For example, an XML node has the following structure:

<passages>
<passage><hlword>Yandex</hlword> - the search engine that can...</passage>
</passages>

To have a single passages column, use:

/collapsedNodes=passages

/firstRow=<first row>

Use this option to define the first data row in the input file.

/firstRowHasNames

Use this option to point out that the input data has headers if gsqlcmd does not detect them.

This option is opposite to the /noSourceHeaders option.

You may use this option with the false value like

/firstRowHasNames=false

/hasRowNum

Use this option to point out that the first column contains row numbers.

You may omit this option if the first column has the _RowNum name.

Use this option to avoid adding an additional column with the /addRowNum option like:

/hasRowNum /addRowNum

Also, you may use this option in the combination with the /addRowNum option to remove the first column:

/hasRowNum /addRowNum=false

/ignoredTags=<tag>[;...]

Use this option to disable creating columns for the specified XML tags.

For example, an XML node has the following structure:

<passages>
<passage><hlword>Yandex</hlword> - the search engine that can...</passage>
</passages>

To ignore the hlword tag, use:

/ignoredTags=hlword

/inputCodePage=<codepage>

Use this option to define the input file code page.

For example:

/inputcodepage=65001

/inputDateFormat=DMY|MDY

Use this option to define the input date date-month order.

gsqlcmd tries to detect this order automatically.

However, you need to specify it if a column contains dates like 1/12/2019 or 12/1/2019 that does not allow detecting the order.

/inputSeparator=<separator>|Tab

Use this option to define the input CSV separator.

gsqlcmd detects it automatically in most cases.

/keptNodes=<node>[;...]

Use this option to specify XML and JSON nodes added to output even if they have no values.

This allows keeping the same output columns for files with small datasets when some columns may have no values.

/noSourceHeaders

Use this option to suppress using the first row of CSV and text files or HTML table headers as column names.

In this case, gsqlcmd creates columns with names like F1, F2, and so on.

This option is extremely useful with the financial statements that use years or quarters as column headers.

This option is opposite to the /firstRowHasNames option.

/numberFields=<field>[<separator>...]

Use this option to force converting column values to numbers.

For example:

/numberColumns=Open;High;Low;Close;Volume

Without this option, gsqlcmd skips converting a column if any column cell contains a value that cannot be converted.

/requiredColumns=<name>[;...]

Use this option to define the columns required for output.

gsqlcmd skips processing the file if any of the specified columns is absent.

For example, you want to load dividends for a list of symbols.

If a company does not pay dividends, its page is empty. So, you may specify the required output columns to skip such pages.

For example:

gsqlcmd convert https://www.nasdaq.com/symbol/aapl/dividend-history aapl.csv /requiredColumns=ExEffDate;Type

/rootPath=<path>[;...]

Use this option to define roots of the output columns explicitly.

Here are several examples for XML, JSON, and HTML sources:

/rootPath=.InvoiceTransmission.Invoice
/rootPath=calls,puts
/rootpath=*.*.timestamp,*.*.*.quote,*.*.*.adjclose
/rootPath=1

Without this option, gsqlcmd detects output columns automatically.

Use the show-roots mode to get roots for XML and JSON files.

Use the show-html-tables mode to get table numbers used as roots with HTML files.

gsqlcmd supports multiple roots with JSON and HTML, and a single root with XML.

/skippedNodes=<node>[;...]

Use this option to exclude XML or JSON nodes from the output.

You may specify column paths like parent1.parent2.column or suffixes like .column.

For example, to exclude columns with data types, use:

/skippedNodes=.type

/stringFields=<field>[<separator>...]

Use this option to skip converting column values to numbers.

For example, use this option to keep values like "2.10" as strings.

Without this option, the tool converts the value to a number value like 2.1.

For example, to keep versions and zip codes as strings, use the option:

/stringColumns=Version;ZipCode
This website is using cookies. By continuing to browse, you give us your consent to our use of cookies as explained in our Cookie Policy.