I have the following text I have a decrypted mini manual which is quite limited but recently I decoded a very simile one that I have many problems when going through the file.. the txt is:
UNB+UNOA:2+925485K200:8+78000M0CL0001:1+171128:0356+688'UNH+1+ORDERS:D:96A:UN'BGM+220::9+4450524787+9'DTM+137:20171128:102'DTM+43E:20171201:102'DTM+10:20171128:102'FTX+SPH+++NO PRETICKET'FTX+SPH+++=============================='FTX+SPH+++IF MULTIPLE DESTINATIONS HAVE'FTX+SPH+++THE SAME SHIP DATE, PLEASE 'FTX+SPH+++SHIP TO FURTHEST DESTINATION'FTX+SPH+++FIRST AND CLOSEST DESTINATIONS'FTX+SPH+++LAST.'FTX+SPH+++=============================='RFF+SD:96'RFF+ZZZ:33'RFF+PD:POS REPLEN'NAD+BY+7807900001686::9++DISTRIBUTION CENTER 6009'NAD+SF+++LA VINOTECA S.A.'RFF+IA:003363960'CUX+2:CLP:9'PAT+1++5:3:D:90'TDT+20++30+31+:::UNITED PARCEL'TOD+6+PO'LIN+1++10635818000040:EN'PIA+1+000247791:IN+577670:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO SB BOT 13G'IMD+F++:::VINOSB13G750'QTY+21:15'MOA+203:507240'PRI+AAB:31656::EUP::CA'PAC+12+3'ALC+C+++1'MOA+23:32400'TAX+7+VAT:52:ILA+20.50:92'MOA+124:97335'LIN+2++10635818000019:EN'PIA+1+000247797:IN+551540:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO CS BOT 13G'IMD+F++:::VINOCS13G750'QTY+21:6'MOA+203:202896'PRI+AAB:31656::EUP::CA'PAC+12+3'ALC+C+++1'MOA+23:12960'TAX+7+VAT:52:ILA+20.50:92'MOA+124:38934'LIN+3++10635818000026:EN'PIA+1+000247800:IN+562058:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO MERLOT'IMD+F++:::VINO ME 14 G 750CC'QTY+21:10'MOA+203:338160'PRI+AAB:31656::EUP::CA'PAC+12+3'ALC+C+++1'MOA+23:21600'TAX+7+VAT:52:ILA+20.50:92'MOA+124:64890'LIN+4++17809531600020:EN'PIA+1+000252847:IN+1361612:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO SAUVIGNON.'IMD+F++:::VINO 13,5 G 750CC'QTY+21:9'MOA+203:395496'PRI+AAB:41784::EUP::CA'PAC+12+3'ALC+C+++1'MOA+23:19440'TAX+7+VAT:52:ILA+20.50:92'MOA+124:77094'LIN+5++10635818000057:EN'PIA+1+000252994:IN+576864:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO CS RES BOT13.5G'IMD+F++:::VINOCS13.5G'QTY+21:2'MOA+203:115380'PRI+AAB:55530::EUP::CA'PAC+12+3'ALC+C+++1'MOA+23:4320'TAX+7+VAT:52:ILA+20.50:92'MOA+124:22768'LIN+6++10635818000064:EN'PIA+1+000253000:IN+577458:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO MERLOT RESERVA'IMD+F++:::VINO 13,5 G 750CC'QTY+21:5'MOA+203:288450'PRI+AAB:55530::EUP::CA'PAC+12+3'ALC+C+++1'MOA+23:10800'TAX+7+VAT:52:ILA+20.50:92'MOA+124:56920'LIN+7++17809531600839:EN'PIA+1+000265725:IN+1880557:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO CA RES BOT 14G'IMD+F++:::VINOCA14G750'QTY+21:1'MOA+203:43944'PRI+AAB:41784::EUP::CA'PAC+12+3'ALC+C+++1'MOA+23:2160'TAX+7+VAT:52:ILA+20.50:92'MOA+124:8566'LIN+8++27808729601174:EN'PIA+1+000270334:IN+3949689:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO CS BOT 14G'IMD+F++:::VINOCS14G750'QTY+21:8'MOA+203:264744'PRI+AAB:30933::EUP::CA'PAC+12+3'ALC+C+++1'MOA+23:17280'TAX+7+VAT:52:ILA+20.50:92'MOA+124:50728'LIN+9++27808729601181:EN'PIA+1+000287879:IN+3949696:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO CA BOT 14G'IMD+F++:::VINOCA14G750'QTY+21:8'MOA+203:264744'PRI+AAB:30933::EUP::CA'PAC+12+3'ALC+C+++1'MOA+23:17280'TAX+7+VAT:52:ILA+20.50:92'MOA+124:50728'LIN+10++17804444001193:EN'PIA+1+000406191:IN+3949641:VN'IMD+C+35+CAJ::92'IMD+C+98+750CC::92'IMD+F++:::VINO CA BOT 13G'IMD+F++:::VINOCA13G750'QTY+21:2'MOA+203:67632'PRI+AAB:31656::EUP::CA'PAC+12+3'ALC+C+++1'MOA+23:4320'TAX+7+VAT:52:ILA+20.50:92'MOA+124:12978'LIN+11++17804604060015:EN'PIA+1+000419437:IN+5127696:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO CA BOT 15G'IMD+F++:::VINOCA15G750'QTY+21:2'MOA+203:76498'PRI+AAB:37169::EUP::CA'PAC+6+3'ALC+C+++1'MOA+23:2160'TAX+7+VAT:52:ILA+20.50:92'MOA+124:15240'LIN+12++17804604060022:EN'PIA+1+000419438:IN+5127702:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO CS BOT 14G'IMD+F++:::VINOCS14G750'QTY+21:4'MOA+203:152996'PRI+AAB:37169::EUP::CA'PAC+6+3'ALC+C+++1'MOA+23:4320'TAX+7+VAT:52:ILA+20.50:92'MOA+124:30480'LIN+13++17804319009682:EN'PIA+1+000428549:IN+5108916:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO CA RES BOT 14G'IMD+F++:::VINOCA14G750'QTY+21:3'MOA+203:173070'PRI+AAB:55530::EUP::CA'PAC+12+3'ALC+C+++1'MOA+23:6480'TAX+7+VAT:52:ILA+20.50:92'MOA+124:34152'LIN+14++17804319009194:EN'PIA+1+000428862:IN+5435739:VN'IMD+C+35+BOT::92'IMD+C+98+375CC::92'IMD+F++:::MERLOT'IMD+F++:::VINO ME 14 G 375CC'QTY+21:2'MOA+203:75898'PRI+AAB:36269::EUP::CA'PAC+24+3'ALC+C+++1'MOA+23:3360'TAX+7+VAT:52:ILA+20.50:92'MOA+124:14870'LIN+15++17804444001346:EN'PIA+1+000465442:IN+5745937:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::MA CHICUREO'IMD+F++:::VINO MA 13.5 G 750CC'QTY+21:1'MOA+203:33816'PRI+AAB:31656::EUP::CA'PAC+12+3'ALC+C+++1'MOA+23:2160'TAX+7+VAT:52:ILA+20.50:92'MOA+124:6489'LIN+16++27802940730705:EN'PIA+1+000465446:IN+5745975:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO CS RES BOT13.5G'IMD+F++:::VINOCS13.5G'QTY+21:19'MOA+203:589285'PRI+AAB:29935::EUP::CA'PAC+6+3'ALC+C+++1'MOA+23:20520'TAX+7+VAT:52:ILA+20.50:92'MOA+124:116603'LIN+17++17804611640118:EN'PIA+1+000465449:IN+5746002:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO SB BOT 13.5G'IMD+F++:::VINOSB13.5G'QTY+21:3'MOA+203:153534'PRI+AAB:49018::EUP::CA'PAC+12+3'ALC+C+++1'MOA+23:6480'TAX+7+VAT:52:ILA+20.50:92'MOA+124:30147'LIN+18++15601007001018:EN'PIA+1+000465451:IN+5746064:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::OPORTO TAWNY'IMD+F++:::OPORTO 19.5 G 750CC'QTY+21:1'MOA+203:40260'PRI+AAB:39180::EUP::CA'PAC+6+3'ALC+C+++1'MOA+23:1080'TAX+7+VAT:52:ILA+31.50:92'MOA+124:12342'LIN+19++17804606601995:EN'PIA+1+000493788:IN+VINOMEESTA:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO ME ESTATE'IMD+F++:::VINO 14G BOT 750CC'QTY+21:9'MOA+203:100089'PRI+AAB:10041::EUP::CA'PAC+6+3'ALC+C+++1'MOA+23:9720'TAX+7+VAT:52:ILA+20.50:92'MOA+124:18522'LIN+20++27802940006022:EN'PIA+1+000517990:IN+POTRODEPIE:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::POTRO DE PIEDRA BLEN'IMD+F++:::VINO 14GR BOT 750CC'QTY+21:1'MOA+203:54526'PRI+AAB:53446::EUP::CA'PAC+6+3'ALC+C+++1'MOA+23:1080'TAX+7+VAT:52:ILA+20.50:92'MOA+124:10956'LIN+21++10635818000545:EN'PIA+1+000578874:IN+5125821:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::SANTA EMA AMPLUS CS'IMD+F++:::VINO SB 14 G 750CC'QTY+21:1'MOA+203:109054'PRI+AAB:106894::EUP::CA'PAC+12+3'PAC+1+1'ALC+C+++1'MOA+23:2160'TAX+7+VAT:52:ILA+20.50:92'MOA+124:21913'LIN+22++17804444001131:EN'PIA+1+000578921:IN+5125715:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::JBOUCHONRESESPMA'IMD+F++:::VINO 13.5 G 750CC'QTY+21:1'MOA+203:62754'PRI+AAB:60594::EUP::CA'PAC+12+3'PAC+1+1'ALC+C+++1'MOA+23:2160'TAX+7+VAT:52:ILA+20.50:92'MOA+124:12422'LIN+23++17804444001155:EN'PIA+1+000578941:IN+5125722:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO CA BOT 13.5G'IMD+F++:::VINOCA13.5G'QTY+21:1'MOA+203:62754'PRI+AAB:60594::EUP::CA'PAC+12+3'PAC+1+1'ALC+C+++1'MOA+23:2160'TAX+7+VAT:52:ILA+20.50:92'MOA+124:12422'LIN+24++10635818000118:EN'PIA+1+000578968:IN+572224:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO CABERNET MERLOT'IMD+F++:::VINO 13.5 G 750CC'QTY+21:3'MOA+203:142686'PRI+AAB:45402::EUP::CA'PAC+12+3'PAC+1+1'ALC+C+++1'MOA+23:6480'TAX+7+VAT:52:ILA+20.50:92'MOA+124:27921'LIN+25++17804625900000:EN'PIA+1+000594393:IN+1:VN'IMD+C+35+BOT::92'IMD+C+98+750CC::92'IMD+F++:::VINO CS BOT 14G'IMD+F++:::VINOCS14G750'QTY+21:2'MOA+203:62028'PRI+AAB:29934::EUP::CA'PAC+6+3'ALC+C+++1'MOA+23:2160'TAX+7+VAT:52:ILA+20.50:92'MOA+124:12272'UNS+S'MOA+86:6067433'CNT+2:25'UNT+281+1'
If you see the only fixed pattern that I see is 'and I see that everything is in a part of the purchase order but I do not know how to go through it letter by letter and when you get it' all that is inside you get it to decipher it .. Any idea is welcome and will be welcomed. I'm new in ruby on rails but I have extensive experience as a developer.
example this one:
BGM+220::9+4450524787+9'
BGM= ORDER TO BUY
220= Type ORDER (TYPE NORMAL or TYPE FULL) but maybe change in other order
for
110
9= nothing
4450524787 = # of ORDER TO BUY
I need to do that in each sector but honestly I can not find how to enter it because no pattern is fixed.
i am try if line.include?('BGM')
but without success I try other things but also without success with an idea I am happy with how to enter and if there is a command that allows me to tell what is inside of 'BGM-XXXXXX-XXX' or something like that would be very useful.
Aucun commentaire:
Enregistrer un commentaire