Table of Contents

Class Csv

Namespace
ToSic.Eav.DataSources
Assembly
ToSic.Eav.DataSources.dll

DataSource for importing/reading CSV files.

The CSV DataSource is part of the Standard EAV Data Sources.

It will load data from a CSV file which is usually located in the App folder (but can also be in ADAM).

These docs are not complete, check out the feature description for now.

History

  1. Introduced in 2sxc 7.2

API Documentation

[PublicApi]
[VisualQuery(NiceName = "CSV Data", UiHint = "Load data from a CSV file", Icon = "description", Type = DataSourceType.Source, NameId = "ToSic.Eav.DataSources.CsvDataSource, ToSic.Eav.DataSources", DynamicOut = false, ConfigurationType = "|Config ToSic.Eav.DataSources.CsvDataSource", HelpLink = "https://go.2sxc.org/DsCsv")]
public class Csv : CustomDataSourceAdvanced, IDataSource, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheKey, ICacheExpiring, ITimestamped, IHasLog, IDataSourceLinkable
Inheritance
Csv
Implements
Inherited Members

Remarks

  • Renamed from CsvDataSource to Csv in v15.06 for consistency. Believe this should not affect anybody.

Properties

ContentType

Name of the content type which the imported entities have. This is fake, but may be necessary for later filtering of the types. Defaults to "CSV"

[Configuration(Fallback = "CSV")]
public string ContentType { get; set; }

Property Value

string

Remarks

  • Before v15.03 it defaulted to "Anonymous"

Delimiter

Delimiter character in the CSV, usually a ',' or ';' but could also be a tab or something. Default is tab.

[Configuration(Fallback = "\t")]
public string Delimiter { get; set; }

Property Value

string

FilePath

Path to the CSV file, relative to the website root

[Configuration]
public string FilePath { get; set; }

Property Value

string

IdColumnName

Column in the CSV which contains the ID.

[Configuration]
public string IdColumnName { get; set; }

Property Value

string

TitleColumnName

The CSV column containing the title of the item - for dropdowns etc. and the EntityTitle property.

[Configuration]
public string TitleColumnName { get; set; }

Property Value

string