Class CsvDataSource
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
- Introduced in 2sxc 7.2
API Documentation
Inheritance
System.Object
ToSic.Lib.Services.ServiceBase
ToSic.Lib.Services.ServiceBase<DataSourceBase.MyServices>
CsvDataSource
Implements
Inherited Members
Namespace: ToSic.Eav.DataSources
Assembly: ToSic.Eav.DataSources.dll
Syntax
[PublicApi_Stable_ForUseInYourCode]
[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://r.2sxc.org/DsCsv")]
public class CsvDataSource : CustomDataSourceAdvanced, IDataSource, IDataSourceSource, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheInfo, ICacheKey, ICacheExpiring, ITimestamped, ICanPurgeListCache, IHasLog, IDataSourceTarget, IDataTarget, IDataSourceShared, IAppIdentitySync, IDataSourceLinkable
Properties
| Improve this Doc View SourceContentType
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"
Declaration
[Configuration(Fallback = "CSV")]
public string ContentType { get; set; }
Property Value
Type | Description |
---|---|
System.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.
Declaration
[Configuration(Fallback = "\t")]
public string Delimiter { get; set; }
Property Value
Type | Description |
---|---|
System.String |
FilePath
Path to the CSV file, relative to the website root
Declaration
[Configuration]
public string FilePath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
IdColumnName
Column in the CSV which contains the ID.
Declaration
[Configuration]
public string IdColumnName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
TitleColumnName
The CSV column containing the title of the item - for dropdowns etc. and the EntityTitle property.
Declaration
[Configuration]
public string TitleColumnName { get; set; }
Property Value
Type | Description |
---|---|
System.String |