Command Line Options

Command Line Options

Common Options

/inputCodepage=<codepage>

The option defines the input file code page.

Example:

/inputcodepage=65001

/outputCodepage=<codepage>

The option defines the output file code page.

Example:

/outputcodepage=1250

/outputCulture=<name>

The option defines the output culture.

Example:

/outputculture=en-GB

/noBOM

The option suppresses adding BOM to Unicode output.

Example:

/noBOM

/echoUrl

The option defines printing URLs to the console.

/echoInputFileName

The option defines printing input file names to the console.

/echoOutputFileName

The option defines printing output file names to the console.

Query Options

/pages=<pages>

The option defines the number of loaded pages.

Example:

/pages=5

/pages=<pageNumberDigitss>

The option defines the number of digits in the output file page number.

Example:

/pageNumberDigits=4

/accept=<accept>

The option defines the Accept header of web requests.

You may specify this option if the default value is not acceptable.

Example:

/accept=application/json;odata=verbose

/userAgent=<user agent>

The option defines the UserAgent header of web requests.

Example:

"/UserAgent=gwebcmd 5.0"

/timeout=<milliseconds>

The option defines the timeout of web requests.

The default timeout is 100 seconds (100 000 ms)

Example:

/timeout=10000

/delay=<milliseconds>

The option defines the delay after requests to prevent banning your IP by web servers.

You may also use the sleep mode in batch files.

Example:

/delay=500

Parser Options

/rootPath=<root path>

The option defines the root elements of columns to output like .InvoiceTransmission.Invoice.

For HTML, a root path is a table number obtained in the HtmlTables mode.

Examples:

/rootPath=.InvoiceTransmission.Invoice
/rootPath=calls,puts
/rootPath=1

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

The option defines the XML nodes that include values of children nodes.

Example:

/collapsedNodes=passages

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

The option defines suffixes of XML nodes to exclude from the output.

To exclude specific columns, use complete paths with column names separated by dots like parent1.parent2.column.

Example:

/skippedNodes=.type

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

The option defines tags to skip as separate columns. The values are included into parent columns.

The typical scenario is ignoring text highlight tags. The option is applicable only with XML.

Example:

/ignoredTags=hlword

/noSourceHeaders=True

The option suppresses using HTML table headers as column names.

Use this option to import financial statements from the web with static column names.

/asIs

The option suppresses any special processing of the output data.

For example, gwebcmd converts Yahoo timestamps to datetime values. You may disable this using the /asIs option.

/rowValues

This option applies XML or JSON parsers that print all values in rows.

This option is useful for learning document structures.

/inputDateFormat=DMY|MDY

The option defines the input date format.

/firstRow=<first row>

The option defines the first data row in the input file.

CSV Options

/append

The option defines adding data to the output CSV file.

/noHeaders

The option suppresses output of column headers.

/addRowNum

The option adds the row number column to the output.

/dateTimeFormat=<format>, /dateFormat=<format>, /timeFormat=<format>

The option defines the format for datetime values in the CSV output.

See available values at https://msdn.microsoft.com/en-us/library/zdtaw1bw(v=vs.100).aspx

Example:

gwebcmd.exe WebToCSV https://finance.yahoo.com/q/hp?s=AAPL aapl.csv /datetimeformat=yyyy-MM-dd

Use quotes to specify formats with spaces. For example:

"/datetimeformat=yyyy-MM-dd hh:mm:ss"

/[output]Separator=<separator>|Tab

The option defines the output CSV separator.

The default separator is a semicolon. Use the Tab value to specify the tab.

Example:

gwebcmd.exe WebToCSV https://finance.yahoo.com/q/hp?s=AAPL aapl.csv /separator=,

/InputSeparator=<separator>|tab

The option defines the input CSV separator.

/quoteChar=<char>

The option defines the character used for quoting string values.

The default value is the double quote. Specify an empty value to disable quoting.

See http://tools.ietf.org/html/rfc4180 about the CSV format.

Examples:

/quoteChar="
/quoteChar=

/escapeChar=<char>

The option defines the character used for quoting quote characters inside string values.

The default value is the double quote. Specify an empty value to disable quoting.

See http://tools.ietf.org/html/rfc4180 about the CSV format.

Examples:

/escapeChar="
/escapeChar=\

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

The option defines the required columns for output.

If the columns are absent, the file is not added to the output.

For example, not all companies pay dividends. So, when you load dividends for a list of symbols, you may specify the required columns to skip such companies.

This is the best way to prevent auto-detecting output columns.

Example:

"/requiredColumns=Ex/Eff Date;Type"

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

The option defines output string columns.

You may use this option to keep values like "2.10" as strings.

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

Example:

/stringColumns=Version;ZipCode

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

The option defines output number columns.

You may use this option to convert input values to numbers even the column contains non-number values.

Example:

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

/add=<header=value>[<separator>...]

The option defines additional data for the CSV output.

You may use constant values or functions described below.

Examples:

gwebcmd.exe WebToCSV  https://finance.yahoo.com/q/hp?s=AAPL aapl.csv /add=File=aapl.csv;Symb=AAPL
gwebcmd.exe TextToCSV aapl.htm *.csv "/add=File=FileName();Symb=FileNameWithoutExtension()"

Functions for /add Options

FunctionMeaning
UtcNow()Current UTC date and time
UtcDateTime()Current UTC date and time
UtcDate()Current UTC date
UtcTime()Current UTC time
Now()Current date and time
DateTime()Current date and time
Date()Current date
Time()Current time
FileDateTime()Input file date and time
FileDateTimeUtc()Input file UTC date and time
FileDate()Input file date
FileDateUtc()Input file UTC date
FileTime()Input file time
FileTimeUtc()Input file UTC time
FileName()Input file name
FileNameOnly()Input file name without extension
FileNameWithoutExtension()Input file name without extension
FileNameWithoutPage()Input file name without extension and page
FilePage()Input file page (2 for "AAPL-02.htm")
FileNameDateTime()Date and time parsed from an input file name *
FileNameDate()Date parsed from an input file name *
FileNameTime()Time parsed from an input file name *

* Supported formats for dates and times in file names:

The value after the first hyphenThe value at the name end
*-yyyyMMddHHmmss*.**yyyyMMddHHmmss.*
*-yyyyMMdd-HHmmss*.**yyyyMMdd-HHmmss.*
*-yyyyMMddTHHmmss*.**yyyyMMddTHHmmss.*
*-yyyy-MM-dd*.**yyyy-MM-dd.*
*-yyyyMMdd*.**yyyyMMdd.*
*-HHmmss*.**HHmmss.*
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.