精华内容
下载资源
问答
  • public static byte[] callMapToXML(Map ...将Map转Xml, Map:" + map.toString()); StringBuffer sb = new StringBuffer(); sb.append("<?xml version=\"1.0\" encod...
    1. public static byte[] callMapToXML(Map map) {  
    2.         logger.info("将Map转成Xml, Map:" + map.toString());  
    3.         StringBuffer sb = new StringBuffer();  
    4.         sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?><bizdata>");  
    5.         mapToXMLTest2(map, sb);  
    6.         sb.append("</bizdata>");  
    7.         logger.info("将Map转成Xml, Xml:" + sb.toString());  
    8.         try {  
    9.             return sb.toString().getBytes("UTF-8");  
    10.         } catch (Exception e) {  
    11.             logger.error(e);  
    12.         }  
    13.         return null;  
    14.     }  
    15.   
    16.     private static void mapToXMLTest2(Map map, StringBuffer sb) {  
    17.         Set set = map.keySet();  
    18.         for (Iterator it = set.iterator(); it.hasNext();) {  
    19.             String key = (String) it.next();  
    20.             Object value = map.get(key);  
    21.             if (null == value)  
    22.                 value = "";  
    23.             if (value.getClass().getName().equals("java.util.ArrayList")) {  
    24.                 ArrayList list = (ArrayList) map.get(key);  
    25.                 sb.append("<" + key + ">");  
    26.                 for (int i = 0; i < list.size(); i++) {  
    27.                     HashMap hm = (HashMap) list.get(i);  
    28.                     mapToXMLTest2(hm, sb);  
    29.                 }  
    30.                 sb.append("</" + key + ">");  
    31.   
    32.             } else {  
    33.                 if (value instanceof HashMap) {  
    34.                     sb.append("<" + key + ">");  
    35.                     mapToXMLTest2((HashMap) value, sb);  
    36.                     sb.append("</" + key + ">");  
    37.                 } else {  
    38.                     sb.append("<" + key + ">" + value + "</" + key + ">");  
    39.                 }  
    40.   
    41.             }  
    42.   
    43.         }  
    44.     }  



    待转化的多层级map代码:

    [java] view plain copy
    1. public static void main(String[] args) {  
    2.         Map<String, Object> dataMap = new LinkedHashMap<String, Object>(); //默认  
    3.         dataMap.put("rtnCode""02");  
    4.         dataMap.put("rtnMsg""查询失败");  
    5.         dataMap.put("idWltCloudDistrict""专区id");  
    6.           
    7.         Map<String, Object> bizMap = new LinkedHashMap<String, Object>();  
    8.         bizMap.put("serviceId""serviceId001");  
    9.         bizMap.put("data", dataMap);//data节点是一个map  
    10.           
    11.         Map<String, Object> objMap = new LinkedHashMap<String, Object>();  
    12.         objMap.put("idWltCloudDistrict""专区id");  
    13.         objMap.put("districtName""专区名称");  
    14.         objMap.put("validateDateStart""专区有效期开始");  
    15.         objMap.put("validateDateEnd""专区有效期结束");  
    16.         objMap.put("status""专区状态(00-待发布;01-销售中; 02-已下架;)");  
    17.         objMap.put("partnerId""合作伙伴id");  
    18.         objMap.put("channelId""渠道id");  
    19.         objMap.put("areaId""商圈专区id");  
    20.         dataMap.putAll(objMap); //  
    21.           
    22.         List<Map<String, Object>> prodKindList1 = new ArrayList<Map<String, Object>>();  
    23.         for(int i=1;i<=2;i++){  
    24.             // 第二层  
    25.             List<Map<String, Object>> prodKindList2 = new ArrayList<Map<String, Object>>();  
    26.             for(int j=1;j<=2;j++){  
    27.                 Map<String, Object> prodKindObj2 = new LinkedHashMap<String, Object>();  
    28.                 prodKindObj2.put("idWltCloudProdKind""类目ID");  
    29.                 prodKindObj2.put("prodKindName""类目名称");  
    30.                 prodKindObj2.put("prodKindIdx""类目序号");  
    31.                 Map<String, Object> prodKind2 = new LinkedHashMap<String, Object>();  
    32.                 prodKind2.put("prodKind", prodKindObj2);  
    33.                 prodKindList2.add(prodKind2);  
    34.             }  
    35.               
    36.             //第一层  
    37.             Map<String, Object> prodKindOjb1 = new LinkedHashMap<String, Object>();  
    38.             prodKindOjb1.put("idWltCloudProdKind""类目ID");  
    39.             prodKindOjb1.put("prodKindName""类目名称");  
    40.             prodKindOjb1.put("prodKindIdx""类目序号");  
    41.             prodKindOjb1.put("prodKindList", prodKindList2);  
    42.             Map<String, Object> prodKind1 = new LinkedHashMap<String, Object>();  
    43.             prodKind1.put("prodKind", prodKindOjb1);  
    44.             prodKindList1.add(prodKind1);  
    45.         }  
    46.           
    47.         dataMap.put("prodKindList", prodKindList1);  
    48.           
    49.         XmlCommonUtil.callMapToXML(bizMap);  
    50.     }  

    转化后效果:

    [java] view plain copy
    1. <?xml version="1.0" encoding="utf-8"?>  
    2. <bizdata>  
    3.     <serviceId>serviceId001</serviceId>  
    4.     <data>  
    5.         <rtnCode>02</rtnCode>  
    6.         <rtnMsg>查询失败</rtnMsg>  
    7.         <idWltCloudDistrict>专区id</idWltCloudDistrict>  
    8.         <districtName>专区名称</districtName>  
    9.         <validateDateStart>专区有效期开始</validateDateStart>  
    10.         <validateDateEnd>专区有效期结束</validateDateEnd>  
    11.         <status>专区状态(00-待发布;01-销售中; 02-已下架;)</status>  
    12.         <partnerId>合作伙伴id</partnerId>  
    13.         <channelId>渠道id</channelId>  
    14.         <areaId>商圈专区id</areaId>  
    15.         <prodKindList>  
    16.             <prodKind>  
    17.                 <idWltCloudProdKind>类目ID</idWltCloudProdKind>  
    18.                 <prodKindName>类目名称</prodKindName>  
    19.                 <prodKindIdx>类目序号</prodKindIdx>  
    20.                 <prodKindList>  
    21.                     <prodKind>  
    22.                         <idWltCloudProdKind>类目ID</idWltCloudProdKind>  
    23.                         <prodKindName>类目名称</prodKindName>  
    24.                         <prodKindIdx>类目序号</prodKindIdx>  
    25.                     </prodKind>  
    26.                     <prodKind>  
    27.                         <idWltCloudProdKind>类目ID</idWltCloudProdKind>  
    28.                         <prodKindName>类目名称</prodKindName>  
    29.                         <prodKindIdx>类目序号</prodKindIdx>  
    30.                     </prodKind>  
    31.                 </prodKindList>  
    32.             </prodKind>  
    33.             <prodKind>  
    34.                 <idWltCloudProdKind>类目ID</idWltCloudProdKind>  
    35.                 <prodKindName>类目名称</prodKindName>  
    36.                 <prodKindIdx>类目序号</prodKindIdx>  
    37.                 <prodKindList>  
    38.                     <prodKind>  
    39.                         <idWltCloudProdKind>类目ID</idWltCloudProdKind>  
    40.                         <prodKindName>类目名称</prodKindName>  
    41.                         <prodKindIdx>类目序号</prodKindIdx>  
    42.                     </prodKind>  
    43.                     <prodKind>  
    44.                         <idWltCloudProdKind>类目ID</idWltCloudProdKind>  
    45.                         <prodKindName>类目名称</prodKindName>  
    46.                         <prodKindIdx>类目序号</prodKindIdx>  
    47.                     </prodKind>  
    48.                 </prodKindList>  
    49.             </prodKind>  
    50.         </prodKindList>  
    51.     </data>  
    52. </bizdata>  
    展开全文
  • implement a python app which can covert hex raw packet data to k12 file. Wireshark can open the k12 file and parse the packet content. #########1.txt########### 09002b00 00050020 8fca980d 81000....

    implement a python app which can covert hex raw packet data to k12 file.

    Wireshark can open the k12 file and parse the packet content.

     

    #########1.txt###########

    09002b00 00050020 8fca980d 8100000a 05d4fefe 03831401 06110100 03020110
    11011011 005a05d1 0081018e 01040349 0001f00f 01008000 04022022 02202200
    800006d3 03000000 e810fe80 00000000 00000220 8ffffeca 980d08ff 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

     

    # ecoding=utf-8
    import re
    def pktfile_raw_2_k12(infile, outfile):
        infile = open(ifn,'rb')
        outfile = open(ofn,'wb')
        all = "" 
        for eachline in infile.readlines():
            #去掉文本行里面的空格 换行 \t(其他有要去除的也可以放到' \r\n\t'里面)
            lines = filter(lambda ch: ch not in ' \r\n\t', eachline)
            all=all+lines 
        # 写出正则表达式 任意2个字符
        pattern = re.compile('.{2}')
        # findall是找到所有的字符,再在字符中添加'|',当然你想添加其他东西当然也可以
        modified_pkt_line = '|'.join(pattern.findall(all))
        modified_pkt_line = '|'+ modified_pkt_line + '|'
        k12_headline = """
        +---------+---------------+----------+
        02:43:09,047,121   ETHER
        |0   """
        k12_pkt_string = k12_headline + modified_pkt_line + "\r\n"+"\r\n"
        outfile.write(k12_pkt_string) 
        infile.close
        outfile.close
    
    ifn = r"1.txt"
    ofn = r"1_k12.txt"
    pktfile_raw_2_k12(ifn, ofn)

     

    #########1_k12.txt###########

    
    +---------+---------------+----------+
    02:43:09,047,121   ETHER
    |0   |09|00|2b|00|00|05|00|20|8f|ca|98|0d|81|00|00|0a|05|d4|fe|fe|03|83|14|01|06|11|01|00|03|02|01|10|11|01|10|11|00|5a|05|d1|00|81|01|8e|01|04|03|49|00|01|f0|0f|01|00|80|00|04|02|20|22|02|20|22|00|80|00|06|d3|03|00|00|00|e8|10|fe|80|00|00|00|00|00|00|02|20|8f|ff|fe|ca|98|0d|08|ff|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|
    
    
    

     

     

    展开全文
  • 其中,会包含EDI通信双方使用哪种传输协议,传输的报文是符合什么标准的,传输的业务报文都包含哪些种类,标准的EDI报文转换成什么格式,是否与企业现有业务系统集成。以上问题,在项目需求沟通初期都务必要确认清楚...

    如果您对EDI项目实施有一定的了解,想必您一定知道,在正式开始EDI项目实施之前,都会有EDI顾问与您接洽,沟通EDI项目需求。其中,会包含EDI通信双方使用哪种传输协议,传输的报文是符合什么标准的,传输的业务报文都包含哪些种类,标准的EDI报文转换成什么格式,是否与企业现有业务系统集成。以上问题,在项目需求沟通初期都务必要确认清楚。

    以上,我们提到标准的EDI报文转换成什么格式,这一问题其实也是很多客户在项目实施中比较纠结的一点。实际上,这主要取决于您企业的信息化情况。通常,企业如已有业务系统,为了实现数据自动化处理,都会选择与现有的业务系统集成,支持的方式有很多,比如金蝶、用友可以通过数据库表方式与EDI系统集成,某客户的物流管理系统选择API方式与EDI系统集成,诸如此类。当然,也存在部分客户没有业务系统的情况,那EDI数据转换成什么格式才方便业务人员读取、操作呢?

    本文以X12 830报文转换为CSV格式文件为例,从收到X12 830报文开始,依次按照系统处理顺序,介绍如何使用知行EDI系统将X12 830报文转换为CSV格式。实际上,CSV这种方案不只是适用于没有业务系统的企业,有的业务系统也是支持直接导入CSV格式文件的,同样也适用CSV方案。

    以下,是一个完整的X12 830报文转换为CSV格式的工作流。其中,经由3个端口处理,最终解析得到CSV格式的830文件。

    e154bb5b4d72eff41d9ad53a3346d0dd.png

    X12ToXML端口

    首先,配置X12端口转换类型(Translation Type)为X12 to XML,用于将X12标准报文转换为XML格式。此外,还要配置Sender Id Qualifier及Sender Identifier等信息。

    40c55ae6f6c9d231df6c1ea2a0f73404.png

    配置完后,在Input界面上传需要转换为CSV格式的X12 830报文。

    ISA*00* *00* *ZZ*O0013000111111 *ZZ*123456 *200227*0700*U*00200*000000045*0*P*>
    GS*PS*O00130001111*123456*20200227*0700*000000045*X*004010
    ST*830*450001
    BFR*05**21*DL*A*20200217**20200227
    N1*MI
    PER*SC**TE*123456788
    N1*ST*ABC*92*1100
    N1*SU*CAB Automotive
    LIN*00020*BP*12AB4356*PO*1234546543
    UIT*PC
    PID*F****HOUSING-TEST
    FST*4032*C*D*20200217*20200217
    FST*6048*C*D*20200224*20200224
    SHP*01*6048*050*20200210
    SHP*02*75456*050*20200210
    CTT*1
    SE*15*450001
    GE*1*000000045
    IEA*1*000000045

    系统默认已开启自动处理,当前X12ToXML端口会自动将X12 830报文转换为XML格式。在Output页面中可以下载并查看。

    <Interchange Delimiters=":*. ^~" xmlns="http://www.rssbus.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <Meta>
     <ISA01>00</ISA01>
     <ISA02> </ISA02>
     <ISA03>00</ISA03>
     <ISA04> </ISA04>
     <ISA05>ZZ</ISA05>
     <ISA06>O0013000111111 </ISA06>
     <ISA07>ZZ</ISA07>
     <ISA08>123456 </ISA08>
     <ISA09>200227</ISA09>
     <ISA10>0700</ISA10>
     <ISA11>U</ISA11>
     <ISA12>00200</ISA12>
     <ISA13>000000045</ISA13>
     <ISA14>0</ISA14>
     <ISA15>P</ISA15>
     <ISA16>&gt;</ISA16>
     </Meta>
     <FunctionalGroup>
     <Meta>
     <GS01>PS</GS01>
     <GS02>O00130001111</GS02>
     <GS03>123456</GS03>
     <GS04>20200227</GS04>
     <GS05>0700</GS05>
     <GS06>000000045</GS06>
     <GS07>X</GS07>
     <GS08>004010</GS08>
     </Meta>
     <TransactionSet>
     <TX-00401-830 type="TransactionSet">
     <Meta>
     <ST01>830</ST01>
     <ST02>450001</ST02>
     </Meta>
     <BFR type="Segment">
     <BFR01>05</BFR01>
     <BFR02 xsi:nil="true"/>
     <BFR03>21</BFR03>
     <BFR04>DL</BFR04>
     <BFR05>A</BFR05>
     <BFR06>20200217</BFR06>
     <BFR07 xsi:nil="true"/>
     <BFR08>20200227</BFR08>
     </BFR>
     <N1Loop1 type="Loop">
     <N1 type="Segment">
     <N101>MI</N101>
     </N1>
     <PER type="Segment">
     <PER01>SC</PER01>
     <PER02 xsi:nil="true"/>
     <PER03>TE</PER03>
     <PER04>123456788</PER04>
     </PER>
     </N1Loop1>
     <N1Loop1 type="Loop">
     <N1 type="Segment">
     <N101>ST</N101>
     <N102>ABC</N102>
     <N103>92</N103>
     <N104>1100</N104>
     </N1>
     </N1Loop1>
     <N1Loop1 type="Loop">
     <N1 type="Segment">
     <N101>SU</N101>
     <N102>CAB Automotive</N102>
     </N1>
     </N1Loop1>
     <LINLoop1 type="Loop">
     <LIN type="Segment">
     <LIN01>00020</LIN01>
     <LIN02>BP</LIN02>
     <LIN03>12AB4356</LIN03>
     <LIN04>PO</LIN04>
     <LIN05>1234546543</LIN05>
     </LIN>
     <UIT type="Segment">
     <UIT01 type="Composite">
     <UIT0101>PC</UIT0101>
     </UIT01>
     </UIT>
     <PID type="Segment">
     <PID01>F</PID01>
     <PID02/>
     <PID03/>
     <PID04 xsi:nil="true"/>
     <PID05>HOUSING-TEST</PID05>
     </PID>
     <FSTLoop1 type="Loop">
     <FST type="Segment">
     <FST01>4032</FST01>
     <FST02>C</FST02>
     <FST03>D</FST03>
     <FST04>20200217</FST04>
     <FST05>20200217</FST05>
     </FST>
     </FSTLoop1>
     <FSTLoop1 type="Loop">
     <FST type="Segment">
     <FST01>6048</FST01>
     <FST02>C</FST02>
     <FST03>D</FST03>
     <FST04>20200224</FST04>
     <FST05>20200224</FST05>
     </FST>
     </FSTLoop1>
     <SHPLoop1 type="Loop">
     <SHP type="Segment">
     <SHP01>01</SHP01>
     <SHP02>6048</SHP02>
     <SHP03>050</SHP03>
     <SHP04>20200210</SHP04>
     </SHP>
     </SHPLoop1>
     <SHPLoop1 type="Loop">
     <SHP type="Segment">
     <SHP01>02</SHP01>
     <SHP02>75456</SHP02>
     <SHP03>050</SHP03>
     <SHP04>20200210</SHP04>
     </SHP>
     </SHPLoop1>
     </LINLoop1>
     <CTT type="Segment">
     <CTT01>1</CTT01>
     </CTT>
     </TX-00401-830>
     </TransactionSet>
     </FunctionalGroup>
    </Interchange>

    XMlMap830端口

    经由X12ToXML端口端口处理后,得到以上XML格式文件。接下来,通过XMlMap830端口处理可以将原本多层复杂结构的知行EDI系统默认XML格式文件转换为单层结构的XML文件。与上一步X12转换为XML不同的是,XMlMap830端口是需要通过界面操作拖拽完成数据关系映射来完成。

    21301fe1c14a3f15f9f6173c2da459b3.png

    转化后,得到以下单层结构的XML格式文件,以便后续CSV端口处理。

    <?xml version="1.0" encoding="UTF-8"?>
    <Items>
     <_830>
     <ForecastNo></ForecastNo>
     <ReleaseNo>21</ReleaseNo>
     <ScheduleType>DL</ScheduleType>
     <ScheduleQtyType>A</ScheduleQtyType>
     <StartDate>20200217</StartDate>
     <ForecastCreateDate>20200227</ForecastCreateDate>
     <NotesID></NotesID>
     <Notes></Notes>
     <RoutingSequenceCode></RoutingSequenceCode>
     <CarrierCode></CarrierCode>
     <TransportMethodCode></TransportMethodCode>
     <RoutingInformation></RoutingInformation>
     <MaterialReleaseIssuerID></MaterialReleaseIssuerID>
     <MaterialReleaseIssuerName></MaterialReleaseIssuerName>
     <MaterialReleaseIssuerAddress1></MaterialReleaseIssuerAddress1>
     <MaterialReleaseIssuerAddress2></MaterialReleaseIssuerAddress2>
     <MaterialReleaseIssuerCity></MaterialReleaseIssuerCity>
     <MaterialReleaseIssuerState></MaterialReleaseIssuerState>
     <MaterialReleaseIssuerPostal></MaterialReleaseIssuerPostal>
     <MaterialReleaseIssuerCountry></MaterialReleaseIssuerCountry>
     <MaterialReleaseIssuerContactCode>SC</MaterialReleaseIssuerContactCode>
     <MaterialReleaseIssuerCommunicationType>TE</MaterialReleaseIssuerCommunicationType>
     <MaterialReleaseIssuerCommunicationNumber>123456788</MaterialReleaseIssuerCommunicationNumber>
     <ShiptoID>1100</ShiptoID>
     <ShiptoName>ABC</ShiptoName>
     <ShiptoAddress1></ShiptoAddress1>
     <ShiptoAddress2></ShiptoAddress2>
     <ShiptoCity></ShiptoCity>
     <ShiptoState></ShiptoState>
     <ShiptoPostal></ShiptoPostal>
     <ShiptoCountry></ShiptoCountry>
     <ShiptoContactCode></ShiptoContactCode>
     <ShiptoCommunicationType></ShiptoCommunicationType>
     <ShiptoCommunicationNumber></ShiptoCommunicationNumber>
     <SupplierID></SupplierID>
     <SupplierName>CAB Automotive</SupplierName>
     <SupplierAddress1></SupplierAddress1>
     <SupplierAddress2></SupplierAddress2>
     <SupplierCity></SupplierCity>
     <SupplierState></SupplierState>
     <SupplierPostal></SupplierPostal>
     <SupplierCountry></SupplierCountry>
     <SupplierContactCode></SupplierContactCode>
     <SupplierCommunicationType></SupplierCommunicationType>
     <SupplierCommunicationNumber></SupplierCommunicationNumber>
     <POLineNumber>00020</POLineNumber>
     <BuyerPartNumber>12AB4356</BuyerPartNumber>
     <PartDescription>HOUSING-TEST</PartDescription>
     <PartRevisionLevel></PartRevisionLevel>
     <PONumber>1234546543</PONumber>
     <Unit>PC</Unit>
     <UnitPrice></UnitPrice>
     <ExpeditorName></ExpeditorName>
     <ExpeditorTel></ExpeditorTel>
     <MaterialSchedulerName></MaterialSchedulerName>
     <MaterialSchedulerTel></MaterialSchedulerTel>
     <ResourceAuthorizationCode></ResourceAuthorizationCode>
     <AuthorizationThroughDate></AuthorizationThroughDate>
     <AuthorizationCumulatedQuantity></AuthorizationCumulatedQuantity>
     <CumulativeStartDate></CumulativeStartDate>
     <Quantity>4032</Quantity>
     <ForecastCode>C</ForecastCode>
     <ForecastTime>D</ForecastTime>
     <ScheduleStartDate>20200217</ScheduleStartDate>
     <ScheduleEndDate>20200217</ScheduleEndDate>
     <ForecastReferenceNumber></ForecastReferenceNumber>
     <LastReceivedQty>6048</LastReceivedQty>
     <CumulativeQtyReceived></CumulativeQtyReceived>
     <CumulativeScrapQtyReceived></CumulativeScrapQtyReceived>
     <LastReceivedDate>20200210</LastReceivedDate>
     <CumulativeQtyReceivedStartDate></CumulativeQtyReceivedStartDate>
     <CumulativeQtyReceivedEndDate></CumulativeQtyReceivedEndDate>
     <CumulativeScrapQtyReceivedStartDate></CumulativeScrapQtyReceivedStartDate>
     <CumulativeScrapQtyReceivedEndDate></CumulativeScrapQtyReceivedEndDate>
     </_830>
     <_830>
     <ForecastNo></ForecastNo>
     <ReleaseNo>21</ReleaseNo>
     <ScheduleType>DL</ScheduleType>
     <ScheduleQtyType>A</ScheduleQtyType>
     <StartDate>20200217</StartDate>
     <ForecastCreateDate>20200227</ForecastCreateDate>
     <NotesID></NotesID>
     <Notes></Notes>
     <RoutingSequenceCode></RoutingSequenceCode>
     <CarrierCode></CarrierCode>
     <TransportMethodCode></TransportMethodCode>
     <RoutingInformation></RoutingInformation>
     <MaterialReleaseIssuerID></MaterialReleaseIssuerID>
     <MaterialReleaseIssuerName></MaterialReleaseIssuerName>
     <MaterialReleaseIssuerAddress1></MaterialReleaseIssuerAddress1>
     <MaterialReleaseIssuerAddress2></MaterialReleaseIssuerAddress2>
     <MaterialReleaseIssuerCity></MaterialReleaseIssuerCity>
     <MaterialReleaseIssuerState></MaterialReleaseIssuerState>
     <MaterialReleaseIssuerPostal></MaterialReleaseIssuerPostal>
     <MaterialReleaseIssuerCountry></MaterialReleaseIssuerCountry>
     <MaterialReleaseIssuerContactCode>SC</MaterialReleaseIssuerContactCode>
     <MaterialReleaseIssuerCommunicationType>TE</MaterialReleaseIssuerCommunicationType>
     <MaterialReleaseIssuerCommunicationNumber>123456788</MaterialReleaseIssuerCommunicationNumber>
     <ShiptoID>1100</ShiptoID>
     <ShiptoName>ABC</ShiptoName>
     <ShiptoAddress1></ShiptoAddress1>
     <ShiptoAddress2></ShiptoAddress2>
     <ShiptoCity></ShiptoCity>
     <ShiptoState></ShiptoState>
     <ShiptoPostal></ShiptoPostal>
     <ShiptoCountry></ShiptoCountry>
     <ShiptoContactCode></ShiptoContactCode>
     <ShiptoCommunicationType></ShiptoCommunicationType>
     <ShiptoCommunicationNumber></ShiptoCommunicationNumber>
     <SupplierID></SupplierID>
     <SupplierName>CAB Automotive</SupplierName>
     <SupplierAddress1></SupplierAddress1>
     <SupplierAddress2></SupplierAddress2>
     <SupplierCity></SupplierCity>
     <SupplierState></SupplierState>
     <SupplierPostal></SupplierPostal>
     <SupplierCountry></SupplierCountry>
     <SupplierContactCode></SupplierContactCode>
     <SupplierCommunicationType></SupplierCommunicationType>
     <SupplierCommunicationNumber></SupplierCommunicationNumber>
     <POLineNumber>00020</POLineNumber>
     <BuyerPartNumber>12AB4356</BuyerPartNumber>
     <PartDescription>HOUSING-TEST</PartDescription>
     <PartRevisionLevel></PartRevisionLevel>
     <PONumber>1234546543</PONumber>
     <Unit>PC</Unit>
     <UnitPrice></UnitPrice>
     <ExpeditorName></ExpeditorName>
     <ExpeditorTel></ExpeditorTel>
     <MaterialSchedulerName></MaterialSchedulerName>
     <MaterialSchedulerTel></MaterialSchedulerTel>
     <ResourceAuthorizationCode></ResourceAuthorizationCode>
     <AuthorizationThroughDate></AuthorizationThroughDate>
     <AuthorizationCumulatedQuantity></AuthorizationCumulatedQuantity>
     <CumulativeStartDate></CumulativeStartDate>
     <Quantity>6048</Quantity>
     <ForecastCode>C</ForecastCode>
     <ForecastTime>D</ForecastTime>
     <ScheduleStartDate>20200224</ScheduleStartDate>
     <ScheduleEndDate>20200224</ScheduleEndDate>
     <ForecastReferenceNumber></ForecastReferenceNumber>
     <LastReceivedQty>6048</LastReceivedQty>
     <CumulativeQtyReceived></CumulativeQtyReceived>
     <CumulativeScrapQtyReceived></CumulativeScrapQtyReceived>
     <LastReceivedDate>20200210</LastReceivedDate>
     <CumulativeQtyReceivedStartDate></CumulativeQtyReceivedStartDate>
     <CumulativeQtyReceivedEndDate></CumulativeQtyReceivedEndDate>
     <CumulativeScrapQtyReceivedStartDate></CumulativeScrapQtyReceivedStartDate>
     <CumulativeScrapQtyReceivedEndDate></CumulativeScrapQtyReceivedEndDate>
     </_830>
    </Items>

    XMlMap830端口

    f6e53cf9a850a94027a41eb106307b6d.png

    最后一步,通过CSV端口就可以将XML格式的文件转换为CSV格式。无需代码,使用端口现有功能即可快速将XML格式转换为CSV格式文件。

    "ForecastNo","ReleaseNo","ScheduleType","ScheduleQtyType","StartDate","ForecastCreateDate","NotesID","Notes","RoutingSequenceCode","CarrierCode","TransportMethodCode","RoutingInformation","MaterialReleaseIssuerID","MaterialReleaseIssuerName","MaterialReleaseIssuerAddress1","MaterialReleaseIssuerAddress2","MaterialReleaseIssuerCity","MaterialReleaseIssuerState","MaterialReleaseIssuerPostal","MaterialReleaseIssuerCountry","MaterialReleaseIssuerContactCode","MaterialReleaseIssuerCommunicationType","MaterialReleaseIssuerCommunicationNumber","ShiptoID","ShiptoName","ShiptoAddress1","ShiptoAddress2","ShiptoCity","ShiptoState","ShiptoPostal","ShiptoCountry","ShiptoContactCode","ShiptoCommunicationType","ShiptoCommunicationNumber","SupplierID","SupplierName","SupplierAddress1","SupplierAddress2","SupplierCity","SupplierState","SupplierPostal","SupplierCountry","SupplierContactCode","SupplierCommunicationType","SupplierCommunicationNumber","POLineNumber","BuyerPartNumber","PartDescription","PartRevisionLevel","PONumber","Unit","UnitPrice","ExpeditorName","ExpeditorTel","MaterialSchedulerName","MaterialSchedulerTel","ResourceAuthorizationCode","AuthorizationThroughDate","AuthorizationCumulatedQuantity","CumulativeStartDate","Quantity","ForecastCode","ForecastTime","ScheduleStartDate","ScheduleEndDate","ForecastReferenceNumber","LastReceivedQty","CumulativeQtyReceived","CumulativeScrapQtyReceived","LastReceivedDate","CumulativeQtyReceivedStartDate","CumulativeQtyReceivedEndDate","CumulativeScrapQtyReceivedStartDate","CumulativeScrapQtyReceivedEndDate"
    "","21","DL","A","20200217","20200227","","","","","","","","","","","","","","","SC","TE","123456788","1100","ABC","","","","","","","","","","","CAB Automotive","","","","","","","","","","00020","12AB4356","HOUSING-TEST","","1234546543","PC","","","","","","","","","","4032","C","D","20200217","20200217","","6048","","","20200210","","","",""
    "","21","DL","A","20200217","20200227","","","","","","","","","","","","","","","SC","TE","123456788","1100","ABC","","","","","","","","","","","CAB Automotive","","","","","","","","","","00020","12AB4356","HOUSING-TEST","","1234546543","PC","","","","","","","","","","6048","C","D","20200224","20200224","","6048","","","20200210","","","",""

    经过以上3个端口的一次处理,原本生涩难懂的X12 830报文已经转为了CSV格式。不论是直接导入现有业务系统或是直接打开查看,您就能轻松地读取到重要的业务信息。现在就下载知行EDI系统,免费试用30天。继续关注知行软件,了解更多EDI系统功能及配置方法,帮您快速上手,搞定EDI项目。

    [Share] 如何将EDI报文转换为CSV格式文件?www.kasoftware.com
    4d591be82aa6e9f962129b04611a934b.png

    f97790a1686e8e4e5d6c871f4279d1c0.png
    展开全文
  • 两个html文件,一开始写了一个引入...都可直接打开使用,进行大写带下划线的报文直接转成驼峰形式的报文,以及驼峰形式转换成大写带下划线的报文,json格式的报文只转换key值,value值不变,不是json格式将会无差别转换
  • txt、csv、trc格式转换成asc

    千次阅读 2020-01-01 19:45:56
    汽车行业采集报文,常常遇到采集的报文格式是txt和csv的,这种格式的报文如果直接分析效率低费时间,可是又无法用CANoe或者CANalyzer等软件直接读取分析,所以自己写了个软件可以将txt或者csv格式的报文转换成asc...

    汽车行业采集报文,常常遇到采集的报文格式是txt和csv的,这种格式的报文如果直接分析效率低费时间,可是又无法用CANoe或者CANalyzer等软件直接读取分析,所以自己写了个软件可以将txt、trc或者csv格式的报文转换成asc格式

    点击打开,选择要转换的文件,可以同时选择多个文件同时转换
    在这里插入图片描述
    市面上CAN卡和上位机软件及版本各种各样,所以保存的报文格式也有区别,第一个和第三个是常见格式类型,实在是没有这两种格式,可以做相应的替换,就可以达到第二种自定义格式,即可进行转换
    如:把第一个格式替换成第二个格式,打开第一个格式的报文,Ctrl+H打开替换窗口,替换内容输入" 接收",以防出错,复制粘贴,替换为处什么都不输,用此方法以此类推,直至替换成与第个种格式相同为止(重复空格没关系,会自动过滤)
    在这里插入图片描述
    软件会自动过滤第一行非数据内容,所以无需手动删除,可以多个文件同时合并生成一个asc文件
    添加文件时添加多了或者添加错了,选中后点删除即可,添加完成后点击转换,转换完成后右侧会有相应的提示转换完成
    转换完之后可以不用关闭窗口,继续添加文件进行转换,之前转过的文件在软件里已无记录,不会重复累加(有强迫症可以把左侧之前的记录删了,那还不如关了重新打开呢)
    转换完的asc格式文件如下
    在这里插入图片描述
    软件下载地址:https://pan.baidu.com/s/1DotMoNFnlmDMJKDraFElGw
    提取码:relm
    其他下载地址:https://download.csdn.net/download/qq_45903987/12277505

    展开全文
  • 然后封装成报文发送给终端,终端在得到报文之后发送给终端,终端在获取到json字符串后读取内容并还原成zip文件包,而且要对zip文件中的某些特定文件内容进行入库保存。 要达到上面的要求,无非是要将zip文件转化成...
  • 然后封装成报文发送给终端,终端在得到报文之后发送给终端,终端在获取到json字符串后读取内容并还原成zip文件包,而且要对zip文件中的某些特定文件内容进行入库保存。要达到上面的要求,无非是要将zip文件转化成...
  • 然后封装成报文发送给终端,终端在得到报文之后发送给终端,终端在获取到json字符串后读取内容并还原成zip文件包,而且要对zip文件中的某些特定文件内容进行入库保存。要达到上面的要求,无非是要将zip文件转化成...
  • 我们的微信支付,使用的是第三方的支付,某银行的微信支持渠道。所有的接口请求、应答都是xml格式报文,这样就需要用到xml格式报文的拼装和解析,这儿简单讲一下。...然后遍历map,将map转换成xml。 [java
  • smooks是一种强大的java数据转换框架。一些xml报文你可能需要装换其标签头,或者把标签的属性转换成元素,或者想把csv格式的文件转换成xml格式,smooks框架是你的选择。
  • 开发中遇到一个问题,就是java返回给我一个16进制,让我进行解密后生成图片文件,并展示出来。 java是这样处理的: 1、先读取图片信息,获取byte[]字节...我们收到的字符串转换成字节流,就是Base64编码的 然后我们...
  • 通过Xml报文生成Java实体类

    千次阅读 2019-05-31 17:10:50
    通过Xml报文生成Java实体类 ...! 通过trang.jar将Xml转成Xsd(xsd文件就是xml的约束文件),再用 Java 自带的 JAXB 工具去生成 Java实体类 ...将xml转换成xsd 方法一:通过trang.jar转换 java -jar t...
  • 有时候分析十六进制的报文,实在费劲,就想了个办法,把它转wireshark可以打开的文件, ...直接复制代码可能有错,error: stray 则说明文件为“带BOM头的UTF8”编码格式,相应的解决方法是将文件转换为“不带BOM头...
  • 转换工具V1.2H.7z

    2020-08-28 16:10:32
    压缩包内包含dbc-Excel互转工具和CAN报文转换工具; dbc-Excel互转工具支持Excel通讯矩阵与dbc...CAN报文转换工具支持.txt和.csv格式的报文转换成asc文件,便于CANoe或者CANalyzer等软件直接读取分析,提高数据分析效率
  • 那么如何将机器的域名转换成IP地址呢?这就需要使用域名查询服务。域名查询服务有很多种实现方式,比如NIS(Network Information Service,网络信息服务)、DNS和本地静态文件等。DNS查询和应答报文详解DNS是一套...
  • wireshark抓取https加密报文,并解密

    万次阅读 2011-04-26 16:44:00
    最后只能将.pfx转换成.pem格式的。 我的wireshark版本是1.4.4,WinPcap版本是4.1.2。 首先还是把.pfx转换成.pem吧 1.下载openssl。 2.导出证书,这里我导出到D:/test.pfx 3.pfx转换...
  • 首先你要有证书,而且这个证书需要是.pem...最后只能将.pfx转换成.pem格式的。 我的wireshark版本是1.4.4,WinPcap版本是4.1.2。 首先还是把.pfx转换成.pem吧 1.下载openssl。 2.导出证书,这里我导出到D:/test.pfx
  • 在写接口时,通常需要把A项目的报文转换成B项目需要的报文,字段名称匹配手动通过set和get方法封装太浪费时间,干脆封装一个工具,只要读取properties配置文件 fieldA=filedB的方式 自动封装B项目需要的报文 代码如下 ...
  • Springboot中传递文件

    2019-06-26 22:36:00
    在公司的项目开发中,需要接收其他服务的文件及向其他文件传递文件,之前是说...但是http是传递的是报文,而报文传递是字节数据,需要转换器转换成我们需要的数据格式,比如String,Object等。  在开发过程中,获...
  • Android上传文件到服务端可以使用HttpConnection 上传文件,也可以使用Android封装好的HttpClient...将文件转换成表单数据流。主要的思路就自己构造个http协议内容,服务端解析报文获得表单数据。代码片段:   [jav
  • 当项目中需要使用XML报文格式转换时, 即可使用 XStream 或 dom4j 等技术进行解决. 常见的三种解析方式 (1)Dom : 文档对象模型 , 要求解析器将整个xml文档装进内存,并解析document 对象 优点: 可增删改 缺点: 文档...
  • 采用springboot框架写了一个定时任务小工具(小工具只是涉及xml报文加工与解密,不涉及数据库)供甲方使用,但小工具逻辑中所需的个别参数:比如盘符名称、定时任务间隔时间等配置在properties文件中,小工具打可...
  • 已经完成了最简单的从pcap文件中读取每个报文,然后再转换成文本格式显示报文头信息,以便于后面分析用,这里做了简单的过滤,根据源目的ip地址,或者查找tcp没有响应的报文。以后又空再完善其他的功能。 ...
  • IP地址是分配给上网设备的数字标签,是每一个网络和设备的逻辑地址,我们在访问网站、发送文件或传输任何报文都会打包一个个数据包,然后按照IP地址,传送数据包。我们上网时在浏览器里输入的网站是方便记忆的域名...
  • 12.4.2 多播组地址到以太网地址的转换 133 12.4.3 FDDI和令牌环网络中的多播 134 12.5 小结 134 第13章 IGMP:Internet组管理协议 136 13.1 引言 136 13.2 IGMP报文 136 13.3 IGMP协议 136 13.3.1 加入一个多播组 ...

空空如也

空空如也

1 2 3 4 5 ... 7
收藏数 123
精华内容 49
关键字:

文件转换成报文