nick g
nick g

Reputation: 3

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.

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.

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

Upvotes: 0

Views: 36

Answers (2)

Solar Mike
Solar Mike

Reputation: 8405

In excel I would do:

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

assuming the data starts in cell A1 then just drag down...

Of course you could have port:user:pass in cell B1 and do:

=A1&":"&B1

which may give you flexibility to change the text if necessary.;

Upvotes: 0

Hemanth Gowda
Hemanth Gowda

Reputation: 620

Use any text editor with a regex replace.

And the regex would be

Find : \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. Or write a simple program to do the same.

Upvotes: 1

Related Questions