.NET库对于固定长度的文本文件 [英] .NET Library For Fixed Length Text Files

查看:164
本文介绍了.NET库对于固定长度的文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在找一个.NET处理固定长度字段文本文件库(在C#中多preferably开源)。它不会过多地写了一个,但现有的测试工作总是更好,下手。

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.

我会从一个PBX产生的文件中提取固定长度字段中的数据。每个交换机都有自己的文件格式,以及一组记录格式。我在找一个库使用动态文件和记录格式的一个很好的一个简单的方法,如:从INI或XML文件读取。

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.

编辑:我previously忽视马科斯梅利'大图书馆 FileHelpers 的,因为我觉得我需要创建一个类在编译时每个记录类型。其实并非如此,和LIB包括 ClassBuilder 类在运行时建立类。

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.

新的编辑:记录从不同交换机的不同之处仅在布局,而不是数据,即所有记录的布局映射到同一类。我不知道我是否应该使用FileHelper属性,动态地从一个配置文件中读取其开始和长度数据?

NEW 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?

推荐答案

我也曾经指出,这个<一个href="https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-6156780.html"相对=nofollow> XML解析code ,以及本的在$ C $的CProject 的类似项目。该越多越好,越接近我会得到一个完美的契合。

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.

这篇关于.NET库对于固定长度的文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆