Skip to main content

Posts

Showing posts from January, 2011

C# code to parse an x9.37 file

The following C# code will parse an X937 file (Image Cash Letter) and get the amounts of each check // BigEndianBitConverter class taken from http://www.yoda.arachsys.com/csharp/miscutil/ // ConvertEBCDICtoASCII method taken from http://kseesharp.blogspot.com/2007/12/convert-ebcdic-to-ascii.html static void Main(string[] args) { var input = new BinaryReader(new FileStream("YourICLFile.icl",FileMode.Open)); byte[] amount_bytes, record_type_bytes; byte[] record_lenght_bytes = input.ReadBytes(4); var converter = new BigEndianBitConverter(); int record_lenght = converter.ToInt32(record_lenght_bytes,0); string record_type, amount_str; //Totals long check_items= 0, total_amount = 0; try { while (true) { //Get record type record_type_bytes = inpu