# Get-OfficeCsv

Loads a CSV document from disk or parses CSV text. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice API Reference.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`System.String[]`

**Outputs**

`OfficeIMO.CSV.CsvDocument`

**Source**

[GetOfficeCsvCommand.cs:35](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Csv/GetOfficeCsvCommand.cs#L35) 

Loads a CSV document from disk or parses CSV text.

## Syntax

```
Get-OfficeCsv
[-AllowEmptyLines]
[-CollectParseErrors]
[-ColumnCountMismatchPolicy <Strict|PadMissingFieldsAndIgnoreExtraFields>]
[-CommentCharacter <Char>]
[-CompressionType <Auto|GZip|Deflate|Brotli|ZLib>]
[-Culture <CultureInfo>]
[-DateTimeFormats <String[]>]
[-Delimiter <Char>]
[-DelimiterText <String>]
[-DuplicateHeaderBehavior <Preserve|Rename|Throw>]
[-Encoding <Encoding>]
[-Header <String[]>]
[-InternStrings]
[-MaxDecompressedBytes <Int64>]
[-MaxFieldLength <Int32>]
[-MaxParseErrors <Int32>]
[-MaxQuotedFieldLength <Int32>]
[-NoHeader]
[-NormalizeQuotes]
[-NullValue <String>]
[-ParseErrorAction <Throw|SkipRow>]
[-Path] <String[]>
[-ProgressInterval <Int32>]
[-QuoteParsingMode <Lenient|Strict>]
[-RecognizeW3CFieldsHeader <Boolean>]
[-SkipCommentRows]
[-SkipCommentRowsBeforeHeader <Boolean>]
[-SkipRows <Int32>]
[-StaticColumns <IDictionary>]
[-TrimWhitespace <Boolean>]
[<CommonParameters>]
```

[#](#member-4d40488a0a27ac76a3dd1007)

Parameter set: `PathDelimiter`

```
Get-OfficeCsv
[-AllowEmptyLines]
[-CollectParseErrors]
[-ColumnCountMismatchPolicy <Strict|PadMissingFieldsAndIgnoreExtraFields>]
[-CommentCharacter <Char>]
[-CompressionType <Auto|GZip|Deflate|Brotli|ZLib>]
[-Culture <CultureInfo>]
[-DateTimeFormats <String[]>]
[-DuplicateHeaderBehavior <Preserve|Rename|Throw>]
[-Encoding <Encoding>]
[-Header <String[]>]
[-InternStrings]
[-MaxDecompressedBytes <Int64>]
[-MaxFieldLength <Int32>]
[-MaxParseErrors <Int32>]
[-MaxQuotedFieldLength <Int32>]
[-NoHeader]
[-NormalizeQuotes]
[-NullValue <String>]
[-ParseErrorAction <Throw|SkipRow>]
[-Path] <String[]>
[-ProgressInterval <Int32>]
[-QuoteParsingMode <Lenient|Strict>]
[-RecognizeW3CFieldsHeader <Boolean>]
[-SkipCommentRows]
[-SkipCommentRowsBeforeHeader <Boolean>]
[-SkipRows <Int32>]
[-StaticColumns <IDictionary>]
[-TrimWhitespace <Boolean>]
-UseCulture
[<CommonParameters>]
```

[#](#member-a21aaf1f379a88f830de64a7)

Parameter set: `PathCulture`

```
Get-OfficeCsv
[-AllowEmptyLines]
[-CollectParseErrors]
[-ColumnCountMismatchPolicy <Strict|PadMissingFieldsAndIgnoreExtraFields>]
[-CommentCharacter <Char>]
[-CompressionType <Auto|GZip|Deflate|Brotli|ZLib>]
[-Culture <CultureInfo>]
[-DateTimeFormats <String[]>]
[-DelimiterCandidates <Char[]>]
-DetectDelimiter
[-DuplicateHeaderBehavior <Preserve|Rename|Throw>]
[-Encoding <Encoding>]
[-Header <String[]>]
[-InternStrings]
[-MaxDecompressedBytes <Int64>]
[-MaxFieldLength <Int32>]
[-MaxParseErrors <Int32>]
[-MaxQuotedFieldLength <Int32>]
[-NoHeader]
[-NormalizeQuotes]
[-NullValue <String>]
[-ParseErrorAction <Throw|SkipRow>]
[-Path] <String[]>
[-ProgressInterval <Int32>]
[-QuoteParsingMode <Lenient|Strict>]
[-RecognizeW3CFieldsHeader <Boolean>]
[-SkipCommentRows]
[-SkipCommentRowsBeforeHeader <Boolean>]
[-SkipRows <Int32>]
[-StaticColumns <IDictionary>]
[-TrimWhitespace <Boolean>]
[<CommonParameters>]
```

[#](#member-6096921b4761b2faefb83290)

Parameter set: `PathDetect`

```
Get-OfficeCsv
[-AllowEmptyLines]
[-CollectParseErrors]
[-ColumnCountMismatchPolicy <Strict|PadMissingFieldsAndIgnoreExtraFields>]
[-CommentCharacter <Char>]
[-CompressionType <Auto|GZip|Deflate|Brotli|ZLib>]
[-Culture <CultureInfo>]
[-DateTimeFormats <String[]>]
[-Delimiter <Char>]
[-DelimiterText <String>]
[-DuplicateHeaderBehavior <Preserve|Rename|Throw>]
[-Encoding <Encoding>]
[-Header <String[]>]
[-InternStrings]
-LiteralPath <String[]>
[-MaxDecompressedBytes <Int64>]
[-MaxFieldLength <Int32>]
[-MaxParseErrors <Int32>]
[-MaxQuotedFieldLength <Int32>]
[-NoHeader]
[-NormalizeQuotes]
[-NullValue <String>]
[-ParseErrorAction <Throw|SkipRow>]
[-ProgressInterval <Int32>]
[-QuoteParsingMode <Lenient|Strict>]
[-RecognizeW3CFieldsHeader <Boolean>]
[-SkipCommentRows]
[-SkipCommentRowsBeforeHeader <Boolean>]
[-SkipRows <Int32>]
[-StaticColumns <IDictionary>]
[-TrimWhitespace <Boolean>]
[<CommonParameters>]
```

[#](#member-fcafcd3eb0fda46d91919d45)

Parameter set: `LiteralPathDelimiter`

```
Get-OfficeCsv
[-AllowEmptyLines]
[-CollectParseErrors]
[-ColumnCountMismatchPolicy <Strict|PadMissingFieldsAndIgnoreExtraFields>]
[-CommentCharacter <Char>]
[-CompressionType <Auto|GZip|Deflate|Brotli|ZLib>]
[-Culture <CultureInfo>]
[-DateTimeFormats <String[]>]
[-DuplicateHeaderBehavior <Preserve|Rename|Throw>]
[-Encoding <Encoding>]
[-Header <String[]>]
[-InternStrings]
-LiteralPath <String[]>
[-MaxDecompressedBytes <Int64>]
[-MaxFieldLength <Int32>]
[-MaxParseErrors <Int32>]
[-MaxQuotedFieldLength <Int32>]
[-NoHeader]
[-NormalizeQuotes]
[-NullValue <String>]
[-ParseErrorAction <Throw|SkipRow>]
[-ProgressInterval <Int32>]
[-QuoteParsingMode <Lenient|Strict>]
[-RecognizeW3CFieldsHeader <Boolean>]
[-SkipCommentRows]
[-SkipCommentRowsBeforeHeader <Boolean>]
[-SkipRows <Int32>]
[-StaticColumns <IDictionary>]
[-TrimWhitespace <Boolean>]
-UseCulture
[<CommonParameters>]
```

[#](#member-988ec1a5a3c03e9fd730518e)

Parameter set: `LiteralPathCulture`

```
Get-OfficeCsv
[-AllowEmptyLines]
[-CollectParseErrors]
[-ColumnCountMismatchPolicy <Strict|PadMissingFieldsAndIgnoreExtraFields>]
[-CommentCharacter <Char>]
[-CompressionType <Auto|GZip|Deflate|Brotli|ZLib>]
[-Culture <CultureInfo>]
[-DateTimeFormats <String[]>]
[-DelimiterCandidates <Char[]>]
-DetectDelimiter
[-DuplicateHeaderBehavior <Preserve|Rename|Throw>]
[-Encoding <Encoding>]
[-Header <String[]>]
[-InternStrings]
-LiteralPath <String[]>
[-MaxDecompressedBytes <Int64>]
[-MaxFieldLength <Int32>]
[-MaxParseErrors <Int32>]
[-MaxQuotedFieldLength <Int32>]
[-NoHeader]
[-NormalizeQuotes]
[-NullValue <String>]
[-ParseErrorAction <Throw|SkipRow>]
[-ProgressInterval <Int32>]
[-QuoteParsingMode <Lenient|Strict>]
[-RecognizeW3CFieldsHeader <Boolean>]
[-SkipCommentRows]
[-SkipCommentRowsBeforeHeader <Boolean>]
[-SkipRows <Int32>]
[-StaticColumns <IDictionary>]
[-TrimWhitespace <Boolean>]
[<CommonParameters>]
```

[#](#member-eda97cf9f919a113b544d8de)

Parameter set: `LiteralPathDetect`

```
Get-OfficeCsv
[-AllowEmptyLines]
[-CollectParseErrors]
[-ColumnCountMismatchPolicy <Strict|PadMissingFieldsAndIgnoreExtraFields>]
[-CommentCharacter <Char>]
[-Culture <CultureInfo>]
[-DateTimeFormats <String[]>]
[-Delimiter <Char>]
[-DelimiterText <String>]
[-DuplicateHeaderBehavior <Preserve|Rename|Throw>]
[-Header <String[]>]
[-InternStrings]
[-MaxFieldLength <Int32>]
[-MaxParseErrors <Int32>]
[-MaxQuotedFieldLength <Int32>]
[-NoHeader]
[-NormalizeQuotes]
[-NullValue <String>]
[-ParseErrorAction <Throw|SkipRow>]
[-ProgressInterval <Int32>]
[-QuoteParsingMode <Lenient|Strict>]
[-RecognizeW3CFieldsHeader <Boolean>]
[-SkipCommentRows]
[-SkipCommentRowsBeforeHeader <Boolean>]
[-SkipRows <Int32>]
[-StaticColumns <IDictionary>]
-Text <String>
[-TrimWhitespace <Boolean>]
[<CommonParameters>]
```

[#](#member-bca49bd5f2c02eee04397601)

Parameter set: `TextDelimiter`

```
Get-OfficeCsv
[-AllowEmptyLines]
[-CollectParseErrors]
[-ColumnCountMismatchPolicy <Strict|PadMissingFieldsAndIgnoreExtraFields>]
[-CommentCharacter <Char>]
[-Culture <CultureInfo>]
[-DateTimeFormats <String[]>]
[-DuplicateHeaderBehavior <Preserve|Rename|Throw>]
[-Header <String[]>]
[-InternStrings]
[-MaxFieldLength <Int32>]
[-MaxParseErrors <Int32>]
[-MaxQuotedFieldLength <Int32>]
[-NoHeader]
[-NormalizeQuotes]
[-NullValue <String>]
[-ParseErrorAction <Throw|SkipRow>]
[-ProgressInterval <Int32>]
[-QuoteParsingMode <Lenient|Strict>]
[-RecognizeW3CFieldsHeader <Boolean>]
[-SkipCommentRows]
[-SkipCommentRowsBeforeHeader <Boolean>]
[-SkipRows <Int32>]
[-StaticColumns <IDictionary>]
-Text <String>
[-TrimWhitespace <Boolean>]
-UseCulture
[<CommonParameters>]
```

[#](#member-184ad5a61057e378edb6a61d)

Parameter set: `TextCulture`

```
Get-OfficeCsv
[-AllowEmptyLines]
[-CollectParseErrors]
[-ColumnCountMismatchPolicy <Strict|PadMissingFieldsAndIgnoreExtraFields>]
[-CommentCharacter <Char>]
[-Culture <CultureInfo>]
[-DateTimeFormats <String[]>]
[-DelimiterCandidates <Char[]>]
-DetectDelimiter
[-DuplicateHeaderBehavior <Preserve|Rename|Throw>]
[-Header <String[]>]
[-InternStrings]
[-MaxFieldLength <Int32>]
[-MaxParseErrors <Int32>]
[-MaxQuotedFieldLength <Int32>]
[-NoHeader]
[-NormalizeQuotes]
[-NullValue <String>]
[-ParseErrorAction <Throw|SkipRow>]
[-ProgressInterval <Int32>]
[-QuoteParsingMode <Lenient|Strict>]
[-RecognizeW3CFieldsHeader <Boolean>]
[-SkipCommentRows]
[-SkipCommentRowsBeforeHeader <Boolean>]
[-SkipRows <Int32>]
[-StaticColumns <IDictionary>]
-Text <String>
[-TrimWhitespace <Boolean>]
[<CommonParameters>]
```

[#](#member-9b56b23103be3cc012d429d1)

Parameter set: `TextDetect`

## Description

Returns an CsvDocument for inspection or further transformations.

## Examples

### Load a CSV file.

```powershell
$csv = Get-OfficeCsv -Path .\data.csv
```

Loads the CSV file into an OfficeIMO CsvDocument.

### Parse CSV text with a custom delimiter.

```powershell
$csv = Get-OfficeCsv -Text \"Name;Total`nAlpha;10\" -Delimiter ';'
```

Parses a semicolon-delimited CSV string into a document.

### Inspect headers as a schema hint.

```powershell
$csv = Get-OfficeCsv -Path .\data.csv; $csv.Header
```

Returns the header list so you can verify the expected column names.

## Parameters

**-AllowEmptyLines SwitchParameter optional**

Allow empty lines in the input.

**-CollectParseErrors SwitchParameter optional**

Collect parse errors and write them as non-terminating errors after each input.

**-ColumnCountMismatchPolicy CsvColumnCountMismatchPolicy optional**

Controls how rows with fewer or more fields than the header are handled.

Possible values: `Strict`, `PadMissingFieldsAndIgnoreExtraFields`

**-CommentCharacter Char optional**

Character that identifies comment rows.

**-CompressionType CsvCompressionType optionalsets: PathDelimiter, PathCulture, PathDetect, LiteralPathDelimiter, LiteralPathCulture, LiteralPathDetect**

Compression used when reading files. Auto infers from the file extension.

Possible values: `Auto`, `GZip`, `Deflate`, `Brotli`, `ZLib`

**-Culture CultureInfo optional**

Culture used for type conversions.

**-DateTimeFormats String[] optional**

Additional date/time formats used by typed conversions and validation.

**-Delimiter Char optionalsets: PathDelimiter, LiteralPathDelimiter, TextDelimiter**

Field delimiter character.

**-DelimiterText String optionalsets: PathDelimiter, LiteralPathDelimiter, TextDelimiter**

Field delimiter text for multi-character delimiters such as || or ::.

**-DuplicateHeaderBehavior CsvDuplicateHeaderBehavior optional**

Controls how duplicate header names are handled.

Possible values: `Preserve`, `Rename`, `Throw`

**-Encoding Encoding optionalsets: PathDelimiter, PathCulture, PathDetect, LiteralPathDelimiter, LiteralPathCulture, LiteralPathDetect**

Encoding used when reading the file.

**-Header String[] optional**

Explicit header names to use; when provided, the first CSV record is treated as data.

**-InternStrings SwitchParameter optional**

Reuse repeated string values through a per-read cache.

**-MaxDecompressedBytes Int64 optionalsets: PathDelimiter, PathCulture, PathDetect, LiteralPathDelimiter, LiteralPathCulture, LiteralPathDetect**

Maximum decompressed bytes to read from compressed CSV files.

**-MaxFieldLength Int32 optional**

Maximum length allowed for any parsed field.

**-MaxParseErrors Int32 optional**

Maximum number of collected parse errors before parsing fails.

**-MaxQuotedFieldLength Int32 optional**

Maximum length allowed for fields parsed from quoted records.

**-NoHeader SwitchParameter optional**

Treat the first record as data and generate default column names.

**-NormalizeQuotes SwitchParameter optional**

Normalize curly quote characters to straight quotes.

**-NullValue String optional**

Token that is materialized as null when loading rows.

**-ParseErrorAction CsvParseErrorAction optional**

How parse errors are handled.

Possible values: `Throw`, `SkipRow`

**-Path String[] requiredposition: 0pipeline: True (ByValue, ByPropertyName)aliases: FilePath, InputPathsets: PathDelimiter, PathCulture, PathDetect**

Path to one or more CSV files. Wildcards are supported.

**-ProgressInterval Int32 optional**

Report progress every N parsed records.

**-QuoteParsingMode CsvQuoteParsingMode optional**

Controls whether malformed quoted fields are parsed leniently or rejected.

Possible values: `Lenient`, `Strict`

**-RecognizeW3CFieldsHeader Boolean optional**

Recognize W3C Extended Log File Format #Fields: rows as headers.

**-SkipCommentRows SwitchParameter optional**

Skip comment rows throughout the file.

**-SkipCommentRowsBeforeHeader Boolean optional**

Skip comment rows starting with # while discovering the header.

**-SkipRows Int32 optional**

Number of parsed CSV records to skip before header discovery or data output.

**-StaticColumns IDictionary optional**

Static columns appended to every loaded row.

**-TrimWhitespace Boolean optional**

Trim whitespace around unquoted fields.

**-UseCulture SwitchParameter requiredsets: PathCulture, LiteralPathCulture, TextCulture**

Use the list separator from the selected or current culture as the delimiter.

**-DelimiterCandidates Char[] optionalsets: PathDetect, LiteralPathDetect, TextDetect**

Delimiter candidates to consider when detecting the delimiter.

**-DetectDelimiter SwitchParameter requiredsets: PathDetect, LiteralPathDetect, TextDetect**

Detect the delimiter from the first meaningful records.

**-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: LP, PSPathsets: LiteralPathDelimiter, LiteralPathCulture, LiteralPathDetect**

Literal path to one or more CSV files.

**-Text String requiredsets: TextDelimiter, TextCulture, TextDetect**

CSV text to parse.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:B678E99B5A0BB0B41C3077EE0F12A5814113F79B6B6FEE11964047CD264EC740 -->
