Snippets tagged csv

  • CSV reader

    I've modified the CSV sample from Expert F# to my needs. I don't wann be forced to use the csv schema as defined by column rows. Therefore I've done two major modifications. 1. remove the permutation 2. added a new column name option to the ColumnAttribute 3. added a name to csv index mapping So basically you now have 3 options. 1. Don't annotate your record at all and use it as POCO. The order of the record fields is mapped directly to the order in the csv. UPDATE: I don't recommend this any more. As of the writing of this snippet I wasn't aware of the fact, that field order isn't guaranted by the reflection mechanism. 2. Use the index option of the ColumnAttribute. Same as before. 3. Use the name option. This is what I've looked for. I've to deal with tons of csv that has more columns I'm interested in. Have a look at the sample usage below. I've moved the type conversion out of the CsvReader class in order to be easyly expandable with custom type conversation (i.e. for combined column values - denormalized data)

    4 people like this

    Posted: 12 years ago by Rainer Schuster

  • String.split

    String split function that skips quoted strings, useful as a simple CSV parser

    7 people like this

    Posted: 10 years ago by Phillip Trelford

  • Course 4: Decision trees and Titanic

    F# introduction course - Get and read the Titanic data set using CSV type provider, define the type of "feature" and use it to classify the data and then implement a simple decision tree that can be used for writing more complex classifiers. To be used in Try F#.

    7 people like this

    Posted: 10 years ago by Tomas Petricek

  • Csv Type Provider Schema Parser

    Parses the schema string format used by the CSV Type Provider from the FSharp.Data library ...because sometimes you need the metadata. Support for names with underscore

    5 people like this

    Posted: 5 years ago by Faisal Waris

  • Csv + Registry

    Had a C tool to parse a csv of queries and check registry against query, then spit out the result, was horrible to parse and model the data in C (just too much code) so I have converted it to F#.

    2 people like this

    Posted: 11 years ago by David Klein

  • Course 3: Exploring Titanic dataset

    F# introduction course - Getting data about Titanic passengers using CSV type provider and analyzing them using standard sequence-processing functions known from LINQ. To be used in Try F#.

    1 people like this

    Posted: 10 years ago by Tomas Petricek

  • CSV writer

    A simple CSV writer implementation as two type extensions for the Seq module. Use it with Records, Classes and Tuples. Have a look at the modified CSV reader sample from Don Symes Expert F# too http://fssnip.net/3T in order to advance this snippet using the ColumnAttribute This version adds quote enclosure support and support for seq datatype.

    5 people like this

    Posted: 6 years ago by Rainer Schuster