将文本复制并粘贴到特定点和线上
所以我有这个 .json 文件和很多我需要放入其中的文本 现在我不想选择所有内容并将其一一粘贴到目的地
所以例如我有“”,我想粘贴我的文本以使其成为
“paste1”
“粘贴2”
“paste3”
我如何能够通过将每一行作为单独的行,但在该行的同一目的地保持相同的格式,将我的内容从 txt 复制到 .jsons 中? 就像我怎样才能在“”之间粘贴东西,但每次粘贴都会在不同的行中结束?
希望有人能帮助我
so i have this .json file and a lot of text i need to put in there
Now i dont want to select everything and paste it one by one to its destination
So for example i have "" and i want paste my text to make it
"paste1"
"paste2"
"paste3"
How would i be able to copy my stuff from the txt, into the .jsons by making every line as seperate line, but keeping it in the same format at the same destination for that line?
Like how can i paste stuff between the "" but every paste would end up in a different line?
Hope someone could help me out
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须将 txt 文件读入一个变量,该变量将在其中存储文件数据。
然后,您必须在每个新行分割数据,这将返回一个您可以根据自己的喜好进行操作的数据数组。
以下是您可能使用 JavaScript 编写的部分代码的示例:
您当然可以以任何您想要的方式操作数据,然后以您想要的任何格式保存数据。
You have to read the txt file into a variable which will store the file data in it.
Then you would have to split the data at every new line which will return an array of data that you can manipulate to your liking.
Here's a sample of part of the code you might write using Javascript:
You can of course manipulate the data in whatever way you want and after that you would save the data in any format you'd like.