• csv格式


    //短信1
    String targetNumber1 = "13459265222";
    String sendNumber1 = "106589658";
    String content1 = "这是一条群发测试短信,短信1";
    
    //短信2
    String targetNumber2 = "13459265223";
    String sendNumber2 = "106589659";
    String content2 = "这是一条群发测试短信,短信2";
    
    StringBuffer csvStr = new StringBuffer();
    
    //组装短信1
    csvStr.append(targetNumber1).append("|").append(sendNumber1).append("|").append(URLEncoder.encode(content1, "utf-8"));
    //加入记录间的分隔符
    csvStr.append("
    ");
    //组装短信2
    csvStr.append(targetNumber2).append("|").append(sendNumber2).append("|").append(URLEncoder.encode(content2, "utf-8"));
    
    //base64编码
    String massInfo = Base64.encode(csvStr.toString());
    
    System.out.println(massInfo);
    
    
     String str = Base64.decode("RDEzMkYxRDFFODE4NkU5OTU3QTAyQTgyMjQ3QkY1MkY4NkNENjc3NE1UTTBOVGt5TmpVeU1qSjhNVEEyTlRnNU5qVTRmQ1ZGT0NWQ1JpVTVPU1ZGTmlVNU9DVkJSaVZGTkNWQ09DVTRNQ1ZGTmlVNVJDVkJNU1ZGTnlWQ1JTVkJOQ1ZGTlNVNFJpVTVNU1ZGTmlWQ05TVTRRaVZGT0NWQlJpVTVOU1ZGTnlVNVJpVkJSQ1ZGTkNWQ1JpVkJNU1V5UXlWRk55VTVSaVZCUkNWRk5DVkNSaVZCTVRFTkNqRXpORFU1TWpZMU1qSXpmREV3TmpVNE9UWTFPWHdsUlRnbFFrWWxPVGtsUlRZbE9UZ2xRVVlsUlRRbFFqZ2xPREFsUlRZbE9VUWxRVEVsUlRjbFFrVWxRVFFsUlRVbE9FWWxPVEVsUlRZbFFqVWxPRUlsUlRnbFFVWWxPVFVsUlRjbE9VWWxRVVFsUlRRbFFrWWxRVEVsTWtNbFJUY2xPVVlsUVVRbFJUUWxRa1lsUVRFeQ==");
    
     System.out.println(str);
     
     String records[] = str.split("
    ");
     for(String record: records){
    	 String fields[] = record.split("\|");
    	 System.out.println("=============================");
    	 for(String field: fields){
    		 if(field.length() > 20){
    			 field = URLDecoder.decode(field, "utf-8");
    		 }
    		 System.out.println(field);
    	 }
    	 System.out.println("=============================");
    	 
    	 
     }
    

      

  • 相关阅读:
    通过wireshark抓包来讲解HTTP中Connection: keep-alive头部的作用
    spring cloud连载第三篇补充之Zuul
    Redis管理各类型存储数据命令
    Redis管理key命令
    Redis命令
    Redis数据类型
    Redis配置文件
    Redis安装
    Redis简介
    SpringBoot项目报错Cannot determine embedded database driver class for database type NONE
  • 原文地址:https://www.cnblogs.com/silentjesse/p/3412487.html
Copyright © 2020-2023  润新知