Name Split
In this simple example, We show how to load in a source file, split the name column into it's first and surnames, then re-save the file.
This uses the Transformer to load data which means it goes through the data identification, cleaning, and import process it uses. To read more about it, check out the Transforms section!
F(x) Expressions are powerful "formulas" you can apply to your data. Check them out to see what else you can use!
//Read file, add first and last name
var tblname = Transformer.TableFromFile(@"InputFile.csv");
tblname.Columns.Add("FirstName", typeof(string));
tblname.Columns.Add("LastName", typeof(string));
//Run an Fx expression over both new columns, splitting up the FullName into it's first and surnames
tblname.FxTable(new Dictionary<string, string>() {
{"FirstName", "name([FullName], 'first')" },
{ "LastName", "name([FullName], 'surname')" }});
//Resave the CSV!
File.WriteAllText(@"Outfile.csv", tblname.ToCSV());Last updated

