Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Library For Fixed Length Text Files

I'm looking for a .NET (much preferably open source in C#) library for dealing with fixed length field text files. It wouldn't be too much to write one, but existing, tested work is always nicer, to start with.

I will be extracting data in fixed length fields from files produced by a PBX. Each PBX has its own file format, as well a set of record formats. I'm looking for a library with a nice a simple way of using dynamic file and record formats, e.g. read from an INI or XML file.

EDIT: I had previously overlooked Marcos Meli' great library FileHelpers, because I thought I needed to create a class for each record type at compile time. This is not so, and the lib includes a ClassBuilder class to build classes at runtime.

NEW EDIT: Records from different PBX's differ only in layout, not in data, i.e. all the record layouts map to the same class. I'm wondering if I should use FileHelper attributes that dynamically read their start and length data from a config file?

like image 781
ProfK Avatar asked Sep 18 '09 12:09

ProfK


1 Answers

I have since been pointed to this XML based parsing code, as well as this similar project on CodeProject. The more the merrier, and the closer I will get to a 'perfect' fit.

like image 54
ProfK Avatar answered Oct 06 '22 09:10

ProfK