php-edifact / edifact

Tools to process EDI messages in UN/EDIFACT format
GNU Lesser General Public License v3.0
275 stars 88 forks source link

CDR read #105

Closed c4ni closed 1 year ago

c4ni commented 3 years ago

Is possible to use this reader library to read CRD format?

https://members.cisac.org/CisacPortal/consulterDocument.do?id=19514

Thanks,

sabas commented 3 years ago

Hi @c4ni I don't think so. As I read the PDF it's a totally different format but you can apply a similar logic

The CRD file structure is based on fixed-length columns (fields) and fixed-length records.

You can split the rows in the proper fields by writing a regular expression containing all the fields length or with mb_substr https://stackoverflow.com/questions/12404360/splitting-string-by-fixed-length

uldisn commented 3 years ago

I get segment descriptions from http://www.unece.org See: https://github.com/uldisn/edifact/blob/master/src/EDI/UnseceOrg.php

sabas commented 3 years ago

@uldisn it is the same data which is converted in xml under https://github.com/php-edifact/edifact-mapping I was wondering why you parse directly the unece website information, am I missing something in my conversion?

uldisn commented 3 years ago

In http://www.unece.org is mode detailed data. First search info in https://github.com/php-edifact/edifact-mapping, but if not found, get segment or element documentation html page and parse it and save in file like as caching.