Parsing EDIFACT file using ruby

gem install edifact_parser
i have used this gem from above git link
but its giving parse error for some EDIFACT files
help me how i can resolve this error?
or suggest me any ruby library for parsing EDIFACT file

I’ve never used the module in question but you might post the error its generating and maybe a link to the data file.


this is the error i am getting with the below EDIFACT file data
UNB+UNOB:1+SENDER1:14:ZZUK+RECEIVER1:1:ZZUK+071101:1701+131++ORDERS++1++1’
UNH+000000101+ORDERS:D:96A:UN’
BGM+220+128576+9’
DTM+137:20020830:102’
NAD+BY+123456::9++KION GROUP AG+Abraham-Lincoln-Str+Wiesbaden++65189+DE’
LIN+1++4000862141404:SRS’
QTY+21:48:PCE’
PRI+AAA:5’
LIN+2++4000862141405:SRS’
QTY+21:2:KGM’
PRI+AAA:55’
LIN+3++4000862141406:SRS’
QTY+21:17:PCE’
PRI+AAA:15’
UNS+S’
UNT+15+000000101’
UNZ+1+131’

I tried the example data here and the parser worked fine, so I would suspect its the data you are using.

You’ll have to wait for someone to chime in that’s familiar with this format.

The line that’s generating the error:

NAD+BY+123456::9++KION GROUP AG+Abraham-Lincoln-Str+Wiesbaden++65189+DE’

As far as I can tell its the hyphens in Abraham-Lincoln-Str… Replace the hyphens with spaces and it works.

can you tell me how you find error in the EDIFACT file?

Its a small file so I used -> process of elimination.

okay thank you so much, i thought you solved using any tools

hi,
one more EDIFACT file is not working please help me
getting parsing error
the github link is

UNA:+.? ’
UNB+UNOA:1+IRONWARE:ZZ+098533326:ZZ+011107:1500+186’
UNH+72+ORDERS:D:97A:UN’
BGM+220+123350+9’
DTM+4:20011107:102’
RFF+CT:97.8400.1734V’
NAD+DP+T01626003+++Hardware BV:Coal Lane+Bradford+Yorkshire+BD9 1SJ’
CTA+PD+:Karen Smith’
COM+030 567891:TE’
CUX+2:USD:9’
PAT+1++5:1:CD:45’
LIN+1++STU62001LW K:BP’
IMD++3+:::SEAGATE VIPER EXT LVD 200G ULTRIUM’
QTY+21:3:EA’
DTM+2:20011108:102’
PRI+INF:3999’
TDT+20++++EXEL GLOBAL LOGIS:172:92’
SCC+1’
QTY+113:3:EA’
DTM+2:20011108:102’
LIN+2++STU42001LW K:BP’
IMD++3+:::SEAGATE VIPER INT LVD 200G ULTRIUM?+’
QTY+21:2:EA’
DTM+2:20011108:102’
PRI+INF:3799’
TDT+20++++EXEL GLOBAL LOGIS:172:92’
SCC+1’
QTY+113:2:EA’
DTM+2:20011108:102’
LIN+3++STUL620001LW K:BP’
IMD++3+:::SEAGATE VIPER EXT LVD ULTRIUM1 11CA’
QTY+21:1:EA’
DTM+2:20011108:102’
PRI+INF:7099’
TDT+20++++EXEL GLOBAL LOGIS:172:92’
SCC+1’
QTY+113:1:EA’
DTM+2:20011108:102’
LIN+4++STUQ:BP’
IMD++3+:::SEA AUTOLOADER RACKMOUNT KIT 5U’
QTY+21:1:EA’
DTM+2:20011108:102’
PRI+INF:379’
TDT+20++++EXEL GLOBAL LOGIS:172:92’
SCC+1’
QTY+113:1:EA’
DTM+2:20011108:102’
UNS+S’
UNT+41+72’
UNZ+1+186’