我正在用Notepad ++编写我的网站,并用Atom编写dapp。在Notepad ++中,我遇到问题,有JSON.parse(''),在''中,我粘贴了从Atom文本编辑器自动生成的文本块,例如:
[
{
"constant": false,
"inputs": [
{
"name": "pIndex",
"type": "uint256"
}
],
"name": "onRegister",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "m_Registry",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "m_RegistryId",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "m_RegistryGroupName",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "onUnregister",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "m_RegistryGroup",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "m_FactoryType",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "pFactoryType",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "pAddress",
"type": "address"
}
],
"name": "EmitAddress",
"type": "event"
},
{
"constant": false,
"inputs": [
{
"name": "pAdminLevel",
"type": "uint256"
}
],
"name": "deploy",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
]
但是我不能直接粘贴它,我必须将其粘贴到其他文件中,全选,联接(ctrl + j),剪切并返回并粘贴在''之间。它可以工作,但是我有很多这样的文件,并且像这样处理每个文件都需要花费时间。
有没有更短的方法来做到这一点?粘贴粘贴的文本或至少粘贴并自动选择会很方便。