将(datatime,iptv) 改成这样的 map(line=> | {val filed=line.split("\\|") | val datatime=filed(2) | val iptv=filed(1) | datatime+","+iptv}) 最后输出结果如下: |
00|iptv2014050901|20171123120126|08 00|iptv2014070803|20171123120127|08 00|iptv2014030803|20171123120132|01 00|iptv2014050901|20171123120156|08 00|iptv2014070803|20171123120157|08 00|iptv2014030803|20171123120202|01 00|iptv2014050901|20171123120226|08 00|iptv2014070803|20171123120227|08 00|iptv2014030803|20171123120232|01 00|iptv2014050901|20171123120256|08 00|iptv2014070803|20171123120257|08 00|iptv2014030803|20171123120302|01 00|iptv2014050901|20171123120326|08 00|iptv2014070803|20171123120327|08 00|iptv2014030803|20171123120332|01 |