We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
省市区编码.txt
相关资源:
The text was updated successfully, but these errors were encountered:
var fs = require('fs'); var readLine = require('lei-stream').readLine; const cityArr = {}; readLine('./myfile.txt').go(function (data, next) { let _tmpArr = data.split(' '); if(_tmpArr[0] && !(_tmpArr[0]%10000)){ console.log(_tmpArr[0]%10000); console.log('市'); cityArr[_tmpArr[1]] = {}; cityArr[_tmpArr[1]].name = _tmpArr[2].replace('\r', ''); cityArr[_tmpArr[1]].areaArr = []; } if(_tmpArr[0] && (_tmpArr[0]%10000) && !(_tmpArr[0]%100)){ console.log('区'); cityArr[_tmpArr[0]].areaArr.push({ name: _tmpArr[1], code: _tmpArr[2].replace('\r', '') }); } next(); }, function () { fs.writeFile('res', JSON.stringify(cityArr)); console.log('end'); });
参考链接:
Sorry, something went wrong.
No branches or pull requests
省市区编码.txt
相关资源:
The text was updated successfully, but these errors were encountered: