.NET Library For Fixed Length Text Files
Asked Answered
P

1

8

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?

Profane answered 18/9, 2009 at 12:6 Comment(0)
P
2

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.

Profane answered 18/9, 2009 at 13:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.