Monday, July 13, 2015

SWIFT Parser like MT103, MT101, MT940 etc

SWIFT Messages Parser

Any SWIFT messages can parse with header or without header. These message format MT103, MT101, MT940 etc. files can be parse using below code.  and multi massages or single massages

Code link

Multi massages Parser

           List<SwiftParser.SwiftParser> files=obj.SWIFTParser(content);
          "BasicHeaderBlock : " + files[0].BasicHeaderBlock
         "ApplicationHeaderBlock : " + files[0].ApplicationHeaderBlock 
         "TrailerBlock : " + files[0].TrailerBlock
          "Messages Count : " + files.Count.ToString() 
           datagrid.DataSource = files[0].FileMessages.FileContent

Massage Body Parser

              SwiftParser.SwiftParser file = new SwiftParser.SwiftParser();
                obj.ParserBody(file, s);
                files.Add(file);

Multi Massages Body Parser



               string[] SeparatorsField = new string[] { Environment.NewLine + "-" };
                string[] findata = content.Split(SeparatorsField, StringSplitOptions.None);
                List<SwiftParser.SwiftParser> files = new List<SwiftParser.SwiftParser>();
                foreach(string s in findata)
                {
                SwiftParser.SwiftParser file = new SwiftParser.SwiftParser();
                obj.ParserBody(file, s);
                files.Add(file);
                }

4 comments:

  1. Hi Sadhukhan, Thanks for the post, do you know how to validate swift message and convert to XML

    ReplyDelete
  2. When is your next version coming buddy??

    ReplyDelete
  3. Currently I am looking JOB. for this reason I can not arrange time.

    ReplyDelete