PB如何处理链表键值对

qj_198127 2021-03-26 10:48:15
[{"provinceCode":"520000","staffName":"张山","sex":"1","idType":"1","idCard":"5224011981020XX979","address":"贵州省","domicileCode":"522401","operTime":"2018-07-31","serialNo":"GZSWNX52000052050000000000061695","workTypeCode":"09001","certificateCode":"5201027010012008603","certificateFirstIssueDate":"2013-07-06","certificateIssueDate":"2014-01-07","certificateExpireDate":"2019-07-05","licenseIssueOrganCode":"52010000","licenseIssueOrganName":"贵阳市道路运输管理局","issueOrganLocCode":"520100","certificateState":"2","certificateType":"1"},{"provinceCode":"520000","staffName":"张山","sex":"1","idType":"1","idCard":"5224011981020XX979","address":"贵州省","domicileCode":"522401","operTime":"2018-07-31","serialNo":"GZSWNX52000052050000000000061695","workTypeCode":"03001","certificateCode":"5224271010012002627","certificateFirstIssueDate":"2014-05-07","certificateIssueDate":"2011-01-02","certificateExpireDate":"2012-03-01","licenseIssueOrganCode":"52052600","licenseIssueOrganName":"威宁自治县道路运输管理局","issueOrganLocCode":"520526","certificateState":"2","certificateType":"1"},{"provinceCode":"520000","staffName":"张山","sex":"1","idType":"1","idCard":"5224011981020XX979","address":"贵州省","domicileCode":"522401","operTime":"2018-07-31","serialNo":"GZSWNX52000052050000000000061695","workTypeCode":"02001","certificateCode":"5224270020011001946","certificateFirstIssueDate":"2014-05-07","certificateIssueDate":"2014-05-11","certificateExpireDate":"2020-05-10","licenseIssueOrganCode":"52052600","licenseIssueOrganName":"威宁自治县道路运输管理局","issueOrganLocCode":"520526","certificateState":"1","certificateType":"1"},{"provinceCode":"520000","staffName":"张山","sex":"1","idType":"1","idCard":"5224011981020XX979","address":"贵州省","domicileCode":"522401","operTime":"2018-07-31","serialNo":"GZSWNX52000052050000000000061695","workTypeCode":"09001","certificateCode":"5224011981020XX979","certificateFirstIssueDate":"2014-09-11","certificateIssueDate":"2014-09-11","certificateExpireDate":"2020-09-10","licenseIssueOrganCode":"52062700","licenseIssueOrganName":"沿河县道路运输局","issueOrganLocCode":"520627","certificateState":"1","certificateType":"1"},{"provinceCode":"520000","staffName":"张山","sex":"1","idType":"1","idCard":"5224011981020XX979","address":"贵州省","domicileCode":"522401","operTime":"2018-07-31","serialNo":"GZSWNX52000052050000000000061695","workTypeCode":"01001","certificateCode":"5224270010011001945","certificateFirstIssueDate":"2014-05-07","certificateIssueDate":"2011-01-02","certificateExpireDate":"2012-03-01","licenseIssueOrganCode":"52052600","licenseIssueOrganName":"威宁自治县道路运输管理局","issueOrganLocCode":"520526","certificateState":"2","certificateType":"1"},{"provinceCode":"520000","staffName":"张山","sex":"1","idType":"1","idCard":"5224011981020XX979","address":"贵州省","domicileCode":"522401","operTime":"2018-07-31","serialNo":"GZSWNX52000052050000000000061695","workTypeCode":"02001","certificateCode":"5202010020201000001","certificateFirstIssueDate":"2009-01-01","certificateIssueDate":"2015-06-27","certificateExpireDate":"2021-06-26","licenseIssueOrganCode":"52020000","licenseIssueOrganName":"六盘水市道路运输局","issueOrganLocCode":"520200","certificateState":"1","certificateType":"1"},{"provinceCode":"520000","staffName":"张山","sex":"1","idType":"1","idCard":"5224011981020XX979","address":"贵州省","domicileCode":"522401","operTime":"2018-07-31","serialNo":"GZSWNX52000052050000000000061695","workTypeCode":"04002","certificateCode":"5224012020112001317","certificateFirstIssueDate":"2015-11-13","certificateIssueDate":"2015-11-13","certificateExpireDate":"2021-11-12","licenseIssueOrganCode":"52050000","licenseIssueOrganName":"毕节市道路运输局","issueOrganLocCode":"520500","certificateState":"1","certificateType":"1"},{"provinceCode":"520000","staffName":"张山","sex":"1","idType":"1","idCard":"5224011981020XX979","address":"贵州省","domicileCode":"522401","operTime":"2018-07-31","serialNo":"GZSWNX52000052050000000000061695","workTypeCode":"01001","certificateCode":"5224010010014000001","certificateFirstIssueDate":"2014-06-12","certificateIssueDate":"2014-08-13","certificateExpireDate":"2020-08-12","licenseIssueOrganCode":"52050000","licenseIssueOrganName":"毕节市道路运输局","issueOrganLocCode":"520500","certificateState":"1","certificateType":"1"},{"provinceCode":"520000","staffName":"张山","sex":"1","idType":"1","idCard":"5224011981020XX979","address":"贵州省","domicileCode":"522401","operTime":"2018-07-31","serialNo":"GZSWNX52000052050000000000061695","workTypeCode":"01001","certificateCode":"5227010010211000003","certificateFirstIssueDate":"2014-07-04","certificateIssueDate":"2014-07-18","certificateExpireDate":"2020-07-17","licenseIssueOrganCode":"52270000","licenseIssueOrganName":"黔南州道路运输管理局","issueOrganLocCode":"522700","certificateState":"1","certificateType":"1"},{"provinceCode":"520000","staffName":"张山","sex":"1","idType":"1","idCard":"5224011981020XX979","address":"贵州省","domicileCode":"522401","operTime":"2018-07-31","serialNo":"GZSWNX52000052050000000000061695","workTypeCode":"02001","certificateCode":"5226010020401000002","certificateFirstIssueDate":"2007-01-01","certificateIssueDate":"2007-01-01","certificateExpireDate":"2013-01-01","licenseIssueOrganCode":"52260000","licenseIssueOrganName":"黔东南州交通运输局","issueOrganLocCode":"522600","certificateState":"2","certificateType":"1"}]

以上为获取的文本内容,如何拆分填写进datawindow窗口,窗口表头为provinceCode,staffName..........certificateType
...全文
669 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
imbounty 2021-03-31
  • 打赏
  • 举报
回复
String str long p1=1,p2,p3 str="需要导入的数据" //以下转换数据格式为数据窗口可导入的格式(去掉列名,列数值用tab分隔,行用换行分隔) do p2=pos(str,'":"',p1) str=replace(str,p1,p2 - p1 +3,'') //去掉列名 p3=pos(str,'"},{"') p1=pos(str,'","') if p3>0 and p1>p3 then str=replace(str,p3,5,"~n") //将串中的"},{"替换为换行 p1=p3+1 else if p1>0 then str=replace(str,p1,3,"~t") //将串中的","替换为tab p1++ end if end if loop until p1<1 str=left(str,lastPos(str,'"') - 1) //去掉结尾多余的字符 dw_1.importString(str) //将转换格式后的数据直接导入数据窗口中(数据窗口中列的顺序应该与数据串中列的顺序相同)
qj_198127 2021-03-30
  • 打赏
  • 举报
回复
终于解决了,硬写函数来拆分
ganzhenyu 2021-03-28
  • 打赏
  • 举报
回复
https://download.csdn.net/download/ganzhenyu/16166897 dw导入、导出json, demo里面有针对楼主数据的处理,打开程序后找<csdn测试>按钮,看里面的代码

610

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder DataWindow
社区管理员
  • DataWindow社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧