# TestExtract

The `TestExtract` code demonstrates the File Extraction interface. The `TestExtract` sample code demonstrates the functionality of the Filtering interface. See TestFilter.

The `TestExtract` code demonstrates the following functionality:

- opens a document
- extracts subfiles from a document
- repeats subfile extraction until all subfiles are extracted
- enables you to specify the command-line options listed in Options for TestExtract

To run `TestExtract`, type the following at the command line:

    FilterTestDotNet -ex [options] input_file output_file

where:

`options` is one or more of the options listed in Options for TestExtract.

`input_file` is the path and file name of the source file.

`output_file` is the path and file name of the output file if the source file is not a container file.

Options for TestExtract

Option | Description
--- | ---
`-cr` | Creates a root directory on which a hierarchy can be based. See Create a Root Node.
`-c` | Specifies that the subfile directory structure is not created.
`-dr binDir` | Specifies the filter working directory where KeyView binaries are stored. Typically, this is the `bin` directory.
`-e` | Extracts the subfiles from a source file but does not filter the files after extraction.
`-ed` | Sets the directory to which the subfiles are extracted.
`-f` | Extracts the formatted version of the message body (HTML or RTF) from mail files when possible.
`-id idfile` | Specifies the user ID file used to open a protected PST file.
`-ip` | Runs file extraction in the same process as the calling application (in process). See Run Filter In Process.
`-is` | Sets the input as a stream. The default is file.
`-l` | Sets the byte order for Unicode text to Little Endian.
`-lg outfile` | Sets the log file name.
`-m` | Extracts default mail metadata and writes it to the log file. See Extract Mail Metadata.
`-nd` | Do not create the subfile directory structure.
`-nh` | Excludes mail header information from the extracted message body text file. See Exclude Metadata from the Extracted Text File.
`-os` | Sets the output as a stream. The default is file.
`-p password` | Specifies the password used to open a protected PST file.
`-sc charset` | Sets the character set of the source file. `charset` is a character set defined in the Filter class. See Coded Character Sets.
`-tc charset` | Sets the character set of the output file. `charset` is a character set defined in the Filter class. See Coded Character Sets.
`-u username` | Specifies the user name used to open a protected PST file.

_FT_HTML5_bannerTitle.htm