About/Contact

Steve Trefethen

Steve Trefethen is a Director of Engineering at Reply. Contact me

View my LinkedIn profile


Powered by discountASP.NET
referal ID: sdtref
Why recommend discountASP.NET?
$720 in referrals so far!


Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

Disclaimer

The posts on this weblog are provided AS IS with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.



Processing fixed length or delimited files quickly and easily in .NET

October 23 2007 8:22AM
I recently ran into a really useful Open Source project called FileHelpers by Marcos Meli. FileHelpers is a .NET library used to import and export data to/from fixed length or delimited text files. The library is highly customizable with good documentation, lots of examples and a record class wizard to help you build classes that match your data.

FileHelpers record class wizard screenshot

It even supports master detail as well as multi-record mappings making it easy to work with all sorts of structured flat file data.

I’ve been working on a large ERP system and I’m currently focused on adding support for EDI Invoicing. EDI is a set of standards for structuring data that’s passed electronically between trading partners. EDI files are structured plain text files and I’m currently investigating FileHelpers MultiRecordEngine class for use with producing and consuming EDI files. I’ve only spent a few hours so far and I already have basic reading and writing of EDI 810 Invoices working.

One thing I did want to mention is that the example on the site for hooking up events is incorrect so here is an example of subscribing to the AfterWriteRecord event:

m_engine = new MultiRecordEngine(GetSelector(), GetRecordTypes()); m_engine.AfterWriteRecord += new EventHandler<AfterWriteRecordEventArgs<object>>(AfterWriteRecord); private void AfterWriteRecord(object sender, AfterWriteRecordEventArgs<object> e) { ... }
FacebookDel.icio.usDigg It!

Comments (2) -

11/4/2007 6:04:29 PM #

Thanks Steve for Publishing the find.  It is very good.

shankar

11/5/2007 3:57:31 AM #

Hi shankar,
You're welcome, I'm glad you've found it useful.

Steve Trefethen

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading