API Reference
Command
Get-OfficeCsv
Loads a CSV document from disk or parses CSV text.
Remarks
Loads a CSV document from disk or parses CSV text.
Examples
Load a CSV file.
PS>$csv = Get-OfficeCsv -Path .\data.csv
Loads the CSV file into an OfficeIMO CsvDocument.
Parse CSV text with a custom delimiter.
PS>$csv = Get-OfficeCsv -Text \"Name;Total`nAlpha;10\" -Delimiter ';'
Parses a semicolon-delimited CSV string into a document.
Inspect headers as a schema hint.
PS>$csv = Get-OfficeCsv -Path .\data.csv; $csv.Header
Returns the header list so you can verify the expected column names.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Get-OfficeCsv [-AllowEmptyLines] [-Culture <CultureInfo>] [-Delimiter <Char>] [-Encoding <Encoding>] [-HasHeaderRow <Boolean>] -InputPath <String> [-Mode <InMemory|Stream>] [-TrimWhitespace <Boolean>] [<CommonParameters>]#Parameter set:
PathParameters
- AllowEmptyLines SwitchParameter
- Allow empty lines in the input.
- Culture CultureInfo
- Culture used for type conversions.
- Delimiter Char
- Field delimiter character.
- Encoding Encoding
- Encoding used when reading the file.
- HasHeaderRow Boolean
- Indicates whether the first record is a header row.
- InputPath String
- Path to the CSV file.
- Mode CsvLoadMode
- Load mode controlling materialization.
- Possible values:
InMemory,Stream - TrimWhitespace Boolean
- Trim whitespace around unquoted fields.
Outputs
OfficeIMO.CSV.CsvDocument
Get-OfficeCsv [-AllowEmptyLines] [-Culture <CultureInfo>] [-Delimiter <Char>] [-Encoding <Encoding>] [-HasHeaderRow <Boolean>] [-Mode <InMemory|Stream>] -Text <String> [-TrimWhitespace <Boolean>] [<CommonParameters>]#Parameter set:
TextParameters
- AllowEmptyLines SwitchParameter
- Allow empty lines in the input.
- Culture CultureInfo
- Culture used for type conversions.
- Delimiter Char
- Field delimiter character.
- Encoding Encoding
- Encoding used when reading the file.
- HasHeaderRow Boolean
- Indicates whether the first record is a header row.
- Mode CsvLoadMode
- Load mode controlling materialization.
- Possible values:
InMemory,Stream - Text String
- CSV text to parse.
- TrimWhitespace Boolean
- Trim whitespace around unquoted fields.
Outputs
OfficeIMO.CSV.CsvDocument