# ConvertFrom-OfficeCsv

Converts CSV text to PSCustomObjects or dictionaries.

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`

**Source**

[ConvertFromOfficeCsvCommand.cs:27](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Csv/ConvertFromOfficeCsvCommand.cs#L27) 

Converts CSV text to PSCustomObjects or dictionaries.

## Syntax

```
ConvertFrom-OfficeCsv
[-AllowEmptyLines]
[-AsHashtable]
[-ColumnCountMismatchPolicy <Strict|PadMissingFieldsAndIgnoreExtraFields>]
[-CommentCharacter <Char>]
[-Culture <CultureInfo>]
[-DateTimeFormats <String[]>]
[-Delimiter <Char>]
[-DelimiterText <String>]
[-DuplicateHeaderBehavior <Preserve|Rename|Throw>]
[-Header <String[]>]
[-Mode <Stream|InMemory>]
[-NoHeader]
[-NullValue <String>]
[-QuoteParsingMode <Lenient|Strict>]
[-RecognizeW3CFieldsHeader <Boolean>]
[-SkipCommentRows]
[-SkipCommentRowsBeforeHeader <Boolean>]
[-SkipRows <Int32>]
[-StaticColumns <IDictionary>]
[-Text] <String>
[-TrimWhitespace <Boolean>]
[<CommonParameters>]
```

[#](#member-642c53cc0efe3bd674da56f7)

Parameter set: `TextDelimiter`

```
ConvertFrom-OfficeCsv
[-AllowEmptyLines]
[-AsHashtable]
[-ColumnCountMismatchPolicy <Strict|PadMissingFieldsAndIgnoreExtraFields>]
[-CommentCharacter <Char>]
[-Culture <CultureInfo>]
[-DateTimeFormats <String[]>]
[-DuplicateHeaderBehavior <Preserve|Rename|Throw>]
[-Header <String[]>]
[-Mode <Stream|InMemory>]
[-NoHeader]
[-NullValue <String>]
[-QuoteParsingMode <Lenient|Strict>]
[-RecognizeW3CFieldsHeader <Boolean>]
[-SkipCommentRows]
[-SkipCommentRowsBeforeHeader <Boolean>]
[-SkipRows <Int32>]
[-StaticColumns <IDictionary>]
[-Text] <String>
[-TrimWhitespace <Boolean>]
-UseCulture
[<CommonParameters>]
```

[#](#member-5115feeff62cd2bdc2b79335)

Parameter set: `TextCulture`

```
ConvertFrom-OfficeCsv
[-AllowEmptyLines]
[-AsHashtable]
[-ColumnCountMismatchPolicy <Strict|PadMissingFieldsAndIgnoreExtraFields>]
[-CommentCharacter <Char>]
[-Culture <CultureInfo>]
[-DateTimeFormats <String[]>]
[-DelimiterCandidates <Char[]>]
-DetectDelimiter
[-DuplicateHeaderBehavior <Preserve|Rename|Throw>]
[-Header <String[]>]
[-Mode <Stream|InMemory>]
[-NoHeader]
[-NullValue <String>]
[-QuoteParsingMode <Lenient|Strict>]
[-RecognizeW3CFieldsHeader <Boolean>]
[-SkipCommentRows]
[-SkipCommentRowsBeforeHeader <Boolean>]
[-SkipRows <Int32>]
[-StaticColumns <IDictionary>]
[-Text] <String>
[-TrimWhitespace <Boolean>]
[<CommonParameters>]
```

[#](#member-4066f0d66ed9cc0db9787d2f)

Parameter set: `TextDetect`

## Description

Reads CSV text from -Text or the pipeline and maps rows by header.

## Examples

### Convert CSV text into rows.

```powershell
$rows = ConvertFrom-OfficeCsv -Text "Name,Value`nAlpha,1"
```

Parses CSV text and emits row objects without writing a temporary file.

### Convert piped CSV lines.

```powershell
"Name,Value", "Alpha,1" | ConvertFrom-OfficeCsv
```

Treats piped lines as one CSV stream.

## Parameters

**-AllowEmptyLines SwitchParameter optional**

Allow empty lines in the input.

**-AsHashtable SwitchParameter optional**

Emit dictionaries instead of PSCustomObjects.

**-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.

**-Culture CultureInfo optional**

Culture used for type conversions.

**-DateTimeFormats String[] optional**

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

**-Delimiter Char optionalsets: TextDelimiter**

Field delimiter character.

**-DelimiterText String optionalsets: 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`

**-Header String[] optional**

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

**-Mode CsvReadMode optional**

Load mode controlling materialization.

Possible values: `Stream`, `InMemory`

**-NoHeader SwitchParameter optional**

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

**-NullValue String optional**

Token that is materialized as null when converting rows.

**-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 input.

**-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 converted row.

**-Text String requiredposition: 0pipeline: True (ByValue)**

CSV text to parse.

**-TrimWhitespace Boolean optional**

Trim whitespace around unquoted fields.

**-UseCulture SwitchParameter requiredsets: TextCulture**

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

**-DelimiterCandidates Char[] optionalsets: TextDetect**

Delimiter candidates to consider when detecting the delimiter.

**-DetectDelimiter SwitchParameter requiredsets: TextDetect**

Detect the delimiter from the first meaningful records.

## 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:63BA5D4ADB7B9AA8E0C7D85A21ADA3FF0A33EF0BD5D81F3C8C1CE3D43EF3665B -->
