Issues with end of segment in Linux for X12 and CVS files

62 views
Skip to first unread message

Antonio Pizarro

unread,
Mar 6, 2022, 10:07:21 AM3/6/22
to Bots Open Source EDI Translator

Hi Henk-Jan Ebbers

I am experiment Bots with Linux and I have the following issues that need help in order to get the right result.

For example i convert cvs file to EDI X12

EDI X12 look like this (part of the file of EDI 210 X12)

ST*210*0029~^M

B3**1619*00023330253M*CC**20160122*8031500**20160119*035*VRLT~^M

N9*CN*VIRGO_LTL~^M

N9*GT*896693249RT~^M

G62*11*20160119~^M

G62*86*20160119~^M

Whats changes I have to do and where to get the result like this in linux

ST*210*0029

B3**1619*00023330253M*CC**20160122*8031500**20160119*035*VRLT

N9*CN*VIRGO_LTL

N9*GT*896693249RT

G62*11*20160119

G62*86*20160119

I also converting EDI X12 to cvs file (in this case EDI 204 X12 to cvs file

cvs file look like this (part of the cvs file)

0204HL11|00023516015M|IL|^M

0204HL11|TPXPRSS_PW04|08|Loblaw Carrier ID^M

0204HAT5|53^M

0204HNTE|CBH|CAD^M

0204HNTE|RPT|From T5V to T9V, 316 Miles^M

0204HDN1|BT|AOP Inc.^M

Whats changes I have to do and where to get the result like this in linux

0204HL11|00023516015M|IL|

0204HL11|TPXPRSS_PW04|08|Loblaw Carrier ID

0204HAT5|53

0204HNTE|CBH|CAD

0204HNTE|RPT|From T5V to T9V, 316 Miles

0204HDN1|BT|AOP Inc.

Any help or hints will be really appreciated

Regards

Antonio Pizarro

Eppye Bots

unread,
Mar 6, 2022, 10:09:28 AM3/6/22
to 'Chuck Turco' via Bots Open Source EDI Translator
change segment separator in grammar.

kind regards, Henk-Jan Ebbers


--
You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/botsmail/09700b86-8d52-4c92-a19b-8e7dbb7c3be1n%40googlegroups.com.

Antonio Pizarro

unread,
Mar 6, 2022, 1:26:49 PM3/6/22
to Bots Open Source EDI Translator
Hi Henk-Jan Ebbers

Thank you very much!!. this solve my problem. Appreciated your help

Regards

Antonio

Antonio Pizarro

unread,
Mar 6, 2022, 6:10:43 PM3/6/22
to Bots Open Source EDI Translator
Hi Henk-Jan Ebbers

Just let you know what I did in order to get the result that I want in case somebody else have the same issues.
For converting EDI X12 to cvs file (in this case EDI 204 X12 to cvs file and don't have ^M at the end of the line
I cd to grammar/csv and edit this file syntaxcsv.py . I added this entry   'record_sep':"\n",
now the file look like this
syntax = {
        'field_sep':'|',
        'quote_char':'',
        'charset':"us-ascii",
        'record_sep':"\n",
        'skip_firstline':False,
        'merge':False,
        'noBOTSID':False,
        }

For converting cvs to EDI X12 to  (in this case csv file to 210 X12
I cd  to bots/usersys/partners/x12 and created a file with the GS_3 of the partner that I am sending the EDI file.
in this case the file that i created is 4167913211.py
This is the information that this file contain
 syntax = {
    'add_crlfafterrecord_sep':'',
    'version':'00401',
    'ISA05':'ZZ',
    'ISA07':'ZZ',
    'ISA08':'NGFRT',
    }

Hope this help somebody and or correct me if I wrong.

Regards
Antonio Pizarro.

Eppye Bots

unread,
Mar 6, 2022, 6:22:31 PM3/6/22
to 'Chuck Turco' via Bots Open Source EDI Translator
that might work for you, not for others
kind regards, Henk-Jan Ebbers


Reply all
Reply to author
Forward
0 new messages