CSV Edit Sharp
CSV Edit Sharp
Rating (0)
Reviews: 0
Category: Utilities & tools
The setting script can be edited in the application and executed immediately.
Sample CSV file.
CSV data display example.
Custom validation API can also be implemented.

Description

CsvEditSharp is a CSV editor that describes read / write settings with C # script.

In the script, write read / write settings using API of “CsvHelper” which is a open source .Net class library.

[Script example]

/* Get the API object that can be used in this script */
ICsvEditSharpApi api = GetCsvEditSharpApi();

/* Encoding of CSV file */
api.Encoding = Encoding.GetEncoding(“utf-8”);

/* Configuration settings for CSV Helper */
api.CsvConfiguration = new CsvConfiguration( CultureInfo.GetCultureInfo(“en-US”))
{
HasHeaderRecord = true
};

/*****************************
Definition of record class
*****************************/
class FieldData
{
public string Name { get; set; }
[Format(“d”)]
public DateTime Birthday { get; set; }
public Gender Gender { get; set; }
public bool Married { get; set; }
[NumberStyles(NumberStyles.Currency)]
[Format(“C”)]
public decimal PocketMoney { get; set; }
}

/****************************************
Define the enum type of selection item
****************************************/
enum Gender
{
Male,
Female,
Other
}

/**********************************************
Register auto class maps in CSV reader/writer
**********************************************/
api.RegisterClassMap();

/************************
Add custom validations
************************/
api.AddValidation<FieldData,DateTime>(
m => m.Birthday,
dt => dt.Date < DateTime.Now.Date,
“Cannot enter a future date.”);

api.AddValidation<FieldData, decimal>(
m => m.PocketMoney,
n => n > 0 && n < 10000,
“PocketMoney must be in the range $0 to $10000.”);


For details of APIs that can be used in scripts, see below.
[GitHub]
https://github.com/pierre3/CsvEditSharp

[CsvHelper]
https://joshclose.github.io/CsvHelper/

Product ID: 9PN205V6THDN
Release date: 2020-02-06
Last update: 2022-03-12