如何使用正则表达式或 Raptorious.SharpMt940Lib 解析 mt940 文件?
How to parse mt940 file by using regex or Raptorious.SharpMt940Lib?
如何使用正则表达式或 Raptorious.SharpMt940Lib 正确解析 mt940 文件?
以下代码返回给我错误:
var header = new Raptorious.SharpMt940Lib.Mt940Format.Separator("STARTUMSE");
var trailer = new Raptorious.SharpMt940Lib.Mt940Format.Separator("-");
var genericFomat = new Raptorious.SharpMt940Lib.Mt940Format.GenericFormat(header, trailer);
using (var fileStream = new FileStream(@"C:\test\ex.txt", FileMode.Open, FileAccess.Read))
{
TextReader tr = new StreamReader(fileStream);
var parsed = Raptorious.SharpMt940Lib.Mt940Parser.Parse(genericFomat, tr);
}
错误:
An unhandled exception of type 'System.IO.InvalidDataException' occurred in Raptorious.SharpMt940Lib.dll
Additional information: Can not find trailer!
示例数据:
:20:6307396651830602
:25:0010-01941/63073966-5183
:28C:00578/001
:60F:C155602TRY2683629,41
:61:1606055Y4774,04NERRNONREF
:86:GOND: HARRAN MAL.OD.HES20160602/201600000003267 S.GN.EMR OKUL 490
5631 NOLU ABONENIN ELEKTRIK TUKETIM BEDELI
:61:160602CY591,20NEFRRONREF
:86:GOND: BIRECIK MA.OD.HES20160602/201600000003244 S.GN.EMR AYggN CP
AL 4914861 NOLU ELEKTRIK ABONESININ FATURA ODEMESI
:61:160602CY2188,54NERRNONREF
库要求 mt940 文件同时具有页眉和页脚。在您的示例中,文件不包含任何内容。
在您的配置中,文件应如下所示:
STARTUMSE
:20:6307396651830602
:25:0010-01941/63073966-5183
:28C:00578/001
:60F:C155602TRY2683629,41
:61:1606055Y4774,04NERRNONREF
:86:GOND: HARRAN MAL.OD.HES20160602/201600000003267 S.GN.EMR OKUL 4905631 NOLU ABONENIN ELEKTRIK TUKETIM BEDELI
:61:160602CY591,20NEFRRONREF
:86:GOND: BIRECIK MA.OD.HES20160602/201600000003244 S.GN.EMR AYggN CPAL 4914861 NOLU ELEKTRIK ABONESININ FATURA ODEMESI
:61:160602CY2188,54NERRNONREF
-
如何使用正则表达式或 Raptorious.SharpMt940Lib 正确解析 mt940 文件?
以下代码返回给我错误:
var header = new Raptorious.SharpMt940Lib.Mt940Format.Separator("STARTUMSE");
var trailer = new Raptorious.SharpMt940Lib.Mt940Format.Separator("-");
var genericFomat = new Raptorious.SharpMt940Lib.Mt940Format.GenericFormat(header, trailer);
using (var fileStream = new FileStream(@"C:\test\ex.txt", FileMode.Open, FileAccess.Read))
{
TextReader tr = new StreamReader(fileStream);
var parsed = Raptorious.SharpMt940Lib.Mt940Parser.Parse(genericFomat, tr);
}
错误:
An unhandled exception of type 'System.IO.InvalidDataException' occurred in Raptorious.SharpMt940Lib.dll
Additional information: Can not find trailer!
示例数据:
:20:6307396651830602
:25:0010-01941/63073966-5183
:28C:00578/001
:60F:C155602TRY2683629,41
:61:1606055Y4774,04NERRNONREF
:86:GOND: HARRAN MAL.OD.HES20160602/201600000003267 S.GN.EMR OKUL 490
5631 NOLU ABONENIN ELEKTRIK TUKETIM BEDELI
:61:160602CY591,20NEFRRONREF
:86:GOND: BIRECIK MA.OD.HES20160602/201600000003244 S.GN.EMR AYggN CP
AL 4914861 NOLU ELEKTRIK ABONESININ FATURA ODEMESI
:61:160602CY2188,54NERRNONREF
库要求 mt940 文件同时具有页眉和页脚。在您的示例中,文件不包含任何内容。
在您的配置中,文件应如下所示:
STARTUMSE
:20:6307396651830602
:25:0010-01941/63073966-5183
:28C:00578/001
:60F:C155602TRY2683629,41
:61:1606055Y4774,04NERRNONREF
:86:GOND: HARRAN MAL.OD.HES20160602/201600000003267 S.GN.EMR OKUL 4905631 NOLU ABONENIN ELEKTRIK TUKETIM BEDELI
:61:160602CY591,20NEFRRONREF
:86:GOND: BIRECIK MA.OD.HES20160602/201600000003244 S.GN.EMR AYggN CPAL 4914861 NOLU ELEKTRIK ABONESININ FATURA ODEMESI
:61:160602CY2188,54NERRNONREF
-