-
Notifications
You must be signed in to change notification settings - Fork 136
QuickFixedLengthWrite
Cinchoo edited this page Jun 16, 2017
·
4 revisions
To generate FixedLength file, use the ChoFixedLengthWriter component to generate it. Sample below shows how to create FixedLength file (Emp.txt)
Id Name
1 Carl
2 Jason
List<ExpandoObject> objs = new List<ExpandoObject>();
dynamic rec1 = new ExpandoObject();
rec1.Id = 1;
rec1.Name = "Mark";
objs.Add(rec1);
dynamic rec2 = new ExpandoObject();
rec2.Id = 2;
rec2.Name = "Jason";
objs.Add(rec2);
using (var parser = new ChoFixedLengthWriter("Emp.txt").WithFirstLineHeader().
WithField("Id", 0, 8).
WithField("Name", 8, 10))
{
parser.Write(objs);
}
using (var parser = new ChoFixedLengthWriter("Emp.txt").WithFirstLineHeader().
WithField("Id", 0, 8).
WithField("Name", 8, 10))
{
dynamic rec1 = new ExpandoObject();
rec1.Id = 1;
rec1.Name = "Mark";
parser.Write(item);
dynamic rec1 = new ExpandoObject();
rec1.Id = 2;
rec1.Name = "Jason";
parser.Write(item);
}
Please visit below article for detailed walk-through of Flat (FixedLength) file writer
©2017 Cinchoo Inc