Deedle


CsvFile

Namespace: FSharp.Data

Represents a CSV file. The lines are read on demand from reader. Columns are delimited by one of the chars passed by separators (defaults to just ,), and to escape the separator chars, the quote character will be used (defaults to "). If hasHeaders is true (the default), the first line read by reader will not be considered part of data. If ignoreErrors is true (the default is false), rows with a different number of columns from the header row (or the first row if headers are not present) will be ignored. The first skipRows lines will be skipped.

Instance members

Instance memberDescription
x.Append(rows)
Signature: rows:seq<'RowType> -> CsvFile<'RowType>

Returns a csv with the same rows as the original plus the provided rows appended

x.Cache()
Signature: unit -> CsvFile<'RowType>

Returns a new csv with the same rows as the original but which guarantees that each row will be only be read and parsed from the input at most once.

x.Filter(predicate)
Signature: predicate:Func<'RowType,bool> -> CsvFile<'RowType>

Returns a new csv containing only the rows for which the given predicate returns "true".

x.GetColumnIndex(columnName)
Signature: columnName:string -> int

Returns the index of the column with the given name

x.Headers
Signature: string [] option

The names of the columns

CompiledName: get_Headers

x.Map(mapping)
Signature: mapping:Func<'RowType,'RowType> -> CsvFile<'RowType>

Returns a new csv where every row has been transformed by the provided mapping function.

x.NumberOfColumns
Signature: int

The number of columns

CompiledName: get_NumberOfColumns

x.Quote
Signature: char

The quotation mark use for surrounding values containing separator chars

CompiledName: get_Quote

x.Rows
Signature: seq<'RowType>

The rows with data

CompiledName: get_Rows

x.Save(path, separator, quote)
Signature: (path:string * separator:char option * quote:char option) -> unit

Saves CSV to the specified file

x.Save(stream, separator, quote)
Signature: (stream:Stream * separator:char option * quote:char option) -> unit

Saves CSV to the specified stream

x.Save(writer, separator, quote)
Signature: (writer:TextWriter * separator:char option * quote:char option) -> unit

Saves CSV to the specified writer

x.SaveToString(separator, quote)
Signature: (separator:char option * quote:char option) -> string

Saves CSV to a string

x.Separators
Signature: string

The character(s) used as column separator(s)

CompiledName: get_Separators

x.Skip(count)
Signature: count:int -> CsvFile<'RowType>

Returns a csv that skips N rows and then yields the remaining rows.

x.SkipWhile(predicate)
Signature: predicate:Func<'RowType,bool> -> CsvFile<'RowType>

Returns a csv that, when iterated, skips rows while the given predicate returns true, and then yields the remaining rows.

x.Take(count)
Signature: count:int -> CsvFile<'RowType>

Returns a new csv with only the first N rows of the underlying csv.

x.TakeWhile(predicate)
Signature: predicate:Func<'RowType,bool> -> CsvFile<'RowType>

Returns a csv that, when iterated, yields rowswhile the given predicate returns true, and then returns no further rows.

x.Truncate(count)
Signature: count:int -> CsvFile<'RowType>

Returns a csv that when enumerated returns at most N rows.

x.TryGetColumnIndex(columnName)
Signature: columnName:string -> int option

Returns the index of the column with the given name, or returns None if no column is found

Static members

Static memberDescription
CsvFile.AsyncLoad(...)
Signature: (uri:string * separators:string option * quote:char option * hasHeaders:bool option * ignoreErrors:bool option * skipRows:int option * encoding:Encoding option) -> Async<CsvFile>

Loads CSV from the specified uri asynchronously

CsvFile.Load(...)
Signature: (uri:string * separators:string option * quote:char option * hasHeaders:bool option * ignoreErrors:bool option * skipRows:int option * encoding:Encoding option) -> CsvFile

Loads CSV from the specified uri

CsvFile.Load(...)
Signature: (reader:TextReader * separators:string option * quote:char option * hasHeaders:bool option * ignoreErrors:bool option * skipRows:int option) -> CsvFile

Loads CSV from the specified reader

CsvFile.Load(...)
Signature: (stream:Stream * separators:string option * quote:char option * hasHeaders:bool option * ignoreErrors:bool option * skipRows:int option) -> CsvFile

Loads CSV from the specified stream

CsvFile.Parse(...)
Signature: (text:string * separators:string option * quote:char option * hasHeaders:bool option * ignoreErrors:bool option * skipRows:int option) -> CsvFile

Parses the specified CSV content

Fork me on GitHub