将前面和后面的文本添加到文本文件中的每个字符串
我有一个文本文件,其中有一堆链接,这些链接全部由空格分隔。我想在每个链接周围添加一个“标签”,使其看起来像这样:
<g:price>linkfromfilegoeshere</g:price>
?
i have a text file that has a bunch of links that are are all delimited by whitespace. i want to add a 'tag' around each link so it looks like this:
<g:price>linkfromfilegoeshere</g:price>
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定我理解是否正确,但这里有一个不整洁的版本,适用于较小的文件。
这可以做得更好,但它是一个开始:)当我稍后有更多时间时我会更新。
Not sure I understand correctly, but here is an untidy version that would work for smaller files.
This could be done a lot better, but its a start :) I will update when I have more time later.