CSV grammar

50 views
Skip to first unread message

Len Finley

unread,
Nov 24, 2024, 4:32:58 PM11/24/24
to Bots Open Source EDI Translator
Hi, 

Hoping someone can help.  Notice below the grammar references shipment date multiple times.  The file references the shipment date in two different columns.  Thinking there's a way to ignore the column headers and just reference by column index.  Appreciate the help!

from bots.botsconfig import *

syntax = {
        'field_sep': '\t',
        'quote_char': '',
        'charset':  "iso-8859-1",
        'merge' : False,
        'noBOTSID': True,   #use this if there is no 'record identification' this is only possible it all records are the same kind of records.
        }

nextmessageblock = ({'BOTSID':'HEA','PO':None})


structure=    [
    {ID:'HEA',MIN:1,MAX:10000}
    ]


recorddefs = {
    'HEA':[
            ['BOTSID','C',3,'A'],
                ['Supplier', 'C', 50, 'AN'],
                ['Delivery Point', 'C', 50, 'AN'],
                ['Buyer', 'C', 50, 'AN'],
                ['Shipment Date', 'C', 50, 'AN'],
                ['Delivery Note No.', 'C', 50, 'AN'],
                ['Total Weight DN', 'C', 50, 'AN'],
                ['Department', 'C', 50, 'AN'],
                ['Carrier', 'C', 50, 'AN'],
                ['TU No.', 'C', 50, 'AN'],
                ['ID of Transport Unit', 'C', 50, 'AN'],
                ['Pos. No.', 'C', 50, 'AN'],
                ['Article No.', 'C', 50, 'AN'],
                ['No. Type', 'C', 50, 'AN'],
                ['Title', 'C', 50, 'AN'],
                ['Order Quantity', 'C', 50, 'AN'],
                ['Shipped Quantity', 'C', 50, 'AN'],
                ['Reported Quantity', 'C', 50, 'AN'],
                ['ASC', 'C', 50, 'AN'],
                ['Backorder Flag', 'C', 50, 'AN'],
                ['Reference', 'C', 50, 'AN'],
                ['Position\'s Order Reference', 'C', 50, 'AN'],
                ['Currency', 'C', 50, 'AN'],
                ['Net Price', 'C', 50, 'AN'],
                ['Net Total Price', 'C', 50, 'AN'],
                ['VAT Value', 'C', 50, 'AN'],
                ['Gross Price', 'C', 50, 'AN'],
                ['Gross Total Price', 'C', 50, 'AN'],
                ['Discount', 'C', 50, 'AN'],
                ['EC Price', 'C', 50, 'AN'],
                ['Fixed Retail Price', 'C', 50, 'AN'],
                ['Commodity Group', 'C', 50, 'AN'],
                ['Shipment Date', 'C', 50, 'AN'],
                ['Shipment Date Flag', 'C', 50, 'AN'],
                ['Label Price 1', 'C', 50, 'AN'],
                ['Label Price 1 Currency', 'C', 50, 'AN'],
                ['Label Price 2', 'C', 50, 'AN'],
                ['Label Price 2 Currency', 'C', 50, 'AN'],
                ['Quality', 'C', 50, 'AN'],
                ['Batch', 'C', 50, 'AN'],
                ['Q/B-Info', 'C', 50, 'AN']
          ],
    }

Eppye Bots

unread,
Nov 25, 2024, 3:49:28 AM11/25/24
to bots...@googlegroups.com
not sure if I understand your question.
but you can name the columns anything you want.

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 visit https://groups.google.com/d/msgid/botsmail/393b6e45-1f09-4387-9542-3b4155b8fe1en%40googlegroups.com.

Len Finley

unread,
Nov 25, 2024, 8:32:53 AM11/25/24
to bots...@googlegroups.com
Hi,

Makes complete sense.  Appreciate your help.  

Regards,
Len

Reply all
Reply to author
Forward
0 new messages