简体   繁体   English

如何自动将文本粘贴到多行的末尾?

[英]How to automatically paste text to the end of multiple lines?

This probably has a really easy solution that I'm overlooking, but say I have a list of IP addresses that I am using as proxies. 这可能是一个我忽略的非常简单的解决方案,但是说我有一个要用作代理的IP地址列表。

for example: 例如:

1.1.1.1

2.2.2.2

3.3.3.3

4.4.4.4

5.5.5.5

and I need to add authentication to each proxy in the form of port:user:pass . 并且我需要以port:user:pass的形式向每个代理添加身份验证。

how can I automatically edit the list to look like this without pasting on each line? 如何自动将列表编辑为如下形式,而无需在每一行上粘贴?

1.1.1.1:port:user:pass

2.2.2.2:port:user:pass

3.3.3.3:port:user:pass

4.4.4.4:port:user:pass

5.5.5.5:port:user:pass

Use any text editor with a regex replace. 使用任何带有正则表达式替换的文本编辑器。

And the regex would be 正则表达式将是

Find : \\s*$ 查找:\\ s * $

Replace with: " My string to be appended" 替换为:“我要附加的字符串”

If your file is too large to open in a text editor, you can use tools like sed to do the same. 如果您的文件太大而无法在文本编辑器中打开,则可以使用sed之类的工具执行相同的操作。 Or write a simple program to do the same. 或编写一个简单的程序来执行相同的操作。

In excel I would do: 在Excel中,我会做:

=A1&":"&"port:user:pass"

assuming the data starts in cell A1 then just drag down... 假设数据从A1单元格开始,然后向下拖动...

Of course you could have port:user:pass in cell B1 and do: 当然,您可以在单元格B1中使用port:user:pass并执行以下操作:

=A1&":"&B1

which may give you flexibility to change the text if necessary.; 如有必要,这可以使您灵活地更改文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM