weixin_50573672 2021-04-09 17:27 采纳率: 25%
浏览 36
已采纳

vs2015如何将txt的内容生成.json文件到本地

这是txt文本的数据

{"type":"ACARS","flight number":"9C8520"," longitude":"117E", "latitude":"39N", "altitude":"8400M"," time":"080810", "Ground speed":"750km/h", "wind speed":"0.2m/s", "wind direction":"southwester","destination address":"TSN","conflict warning information":"/","mode":"A"};
{"type":"SSR","flight number":"CA1437"," longitude":"107E", "latitude":"36N", "altitude":"7600M"," time":"080910", "Ground speed":"780km/h", "wind speed":"0.1m/s", "wind direction":"southwester","destination address":"CKG","conflict warning information":"/","mode":"/"};
{"type":"ACARS","flight number":"FM9070"," longitude":"117E", "latitude":"35N", "altitude":"6400M"," time":"081010", "Ground speed":"790km/h", "wind speed":"0m/s", "wind direction":"/","destination address":"SHA","conflict warning information":"/","mode":"A"};
{"type":"ADS-B","flight number":"PN6238"," longitude":"107E", "latitude":"29N", "altitude":"8700M"," time":"081120", "Ground speed":"750km/h", "wind speed":"0.5m/s", "wind direction":"southwester","destination address":"CKG","conflict warning information":"/","mode":"/"};
{"type":"ACARS","flight number":"CZ6605"," longitude":"117E", "latitude":"38N", "altitude":"9000M"," time":"081210", "Ground speed":"850km/h", "wind speed":"0.3m/s", "wind direction":"southwester","destination address":"BJS","conflict warning information":"/","mode":"A"};
{"type":"ACARS","flight number":"CX391"," longitude":"121E", "latitude":"39N", "altitude":"10000M"," time":"081310", "Ground speed":"740km/h", "wind speed":"0m/s", "wind direction":"/","destination address":"TYO","conflict warning information":"/","mode":"A"};
{"type":"SSR","flight number":"MU2102"," longitude":"117E", "latitude":"37N", "altitude":"8000M"," time":"081410", "Ground speed":"730km/h", "wind speed":"0.2m/s", "wind direction":"southwester","destination address":"SIA","conflict warning information":"/","mode":"/"};
{"type":"ACARS","flight number":"HU7291"," longitude":"107E", "latitude":"39N", "altitude":"12000M"," time":"081510", "Ground speed":"720km/h", "wind speed":"0.1m/s", "wind direction":"southwester","destination address":"XMN","conflict warning information":"/","mode":"A"};
{"type":"ADS-B","flight number":"CZ6716"," longitude":"118E", "latitude":"36N", "altitude":"8600M"," time":"081610", "Ground speed":"710km/h", "wind speed":"0m/s", "wind direction":"/","destination address":"SYX","conflict warning information":"/","mode":"/"};
{"type":"ACARS","flight number":"SC4650"," longitude":"119E", "latitude":"31N", "altitude":"8700M"," time":"081650", "Ground speed":"700km/h", "wind speed":"0m/s", "wind direction":"/","destination address":"TAO","conflict warning information":"/","mode":"A"};
{"type":"ADS-B","flight number":"CA1445"," longitude":"108E", "latitude":"40N", "altitude":"8400M"," time":"091720", "Ground speed":"750km/h", "wind speed":"0m/s", "wind direction":"/","destination address":"HGH","conflict warning information":"/","mode":"/"};
{"type":"ACARS","flight number":"CA8684"," longitude":"117E", "latitude":"39N", "altitude":"8500M"," time":"081910", "Ground speed":"760km/h", "wind speed":"0.1m/s", "wind direction":"southwester","destination address":"WHU","conflict warning information":"/","mode":"A"};
{"type":"SSR","flight number":"CZ3140"," longitude":"104E", "latitude":"39N", "altitude":"7600M"," time":"082030", "Ground speed":"780km/h", "wind speed":"0m/s", "wind direction":"/","destination address":"CKG","conflict warning information":"/","mode":"/"};
{"type":"ACARS","flight number":"3U8724"," longitude":"116E", "latitude":"42N", "altitude":"8400M"," time":"082110", "Ground speed":"790km/h", "wind speed":"0m/s", "wind direction":"southwester","destination address":"KMG","conflict warning information":"/","mode":"A"};
{"type":"ACARS","flight number":"NX009"," longitude":"113E", "latitude":"44N", "altitude":"8800M"," time":"092210", "Ground speed":"780km/h", "wind speed":"0.2m/s", "wind direction":"southwester","destination address":"MFM","conflict warning information":"/","mode":"A"};

 

  • 写回答

1条回答 默认 最新

  • lemon-l 2021-04-09 18:18
    关注

    你这其实只要把';'换成',',最后一个';'去掉,然后在开头加[,结尾加],保存成文件名为xxx.json的文件就行了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么