FileHelperEngineTReadFileAsList Method (String) |
Note: This API is now obsolete.
Namespace: FileHelpers
[ObsoleteAttribute("Please use ReadFile(...).AsList() instead.")] public List<T> ReadFileAsList( string fileName )
using FileHelpers; // First declare the record class [Delimitedrecord("|")] public class SampleType { public string Field1; public int Field2; } public void ReadExample() { var engine = new FileHelperEngine<SampleType>(); var records = engine.ReadFile("source.txt"); // Now "records" array contains all the records in the // sourcefile and can be acceded like this: int sum = records[0].Field2 + records[1].Field2; }