-1

I have this file :

example-site1.com      site-site1.com     user1    password1
example-site2.com   site-site2.com    user2    password2
example-site3.com      site-site3.com    user3    password3

there are irregular spaces, and i want to add port 80 behind the site and the @ character

i need to arrange the words like this :

example-site1.com:80@user1@password1
example-site2.com:80@user2@password2
example-site3.com:80@user3@password3

can someone help me?

Thanks.

gmps org
  • 23
  • 8

1 Answers1

0
  • Ctrl+H
  • Find what: ^(\S+)\h+\S+\h+(\S+)\h+(\S+)
  • Replace with: $1:80@$2@$3
  • CHECK Wrap around
  • CHECK Regular expression
  • Replace all

Explanation:

^           # beginning of line
  (\S+)     # group 1, 1 or more non spaces (domain)
  \h+       # 1 or more horizontal spaces
  \S+       # 1 or more non spaces
  \h+       # 1 or more horizontal spaces
  (\S+)     # group 2, 1 or more non spaces (user)
  \h+       # 1 or more horizontal spaces
  (\S+)     # group 3, 1 or more non spaces (password)

Replacement:

$1      # content of group 1
:80@    # literally :80@
$2      # content of group 2
@       # literally @
$3      # content of group 3

Screenshot (before):

enter image description here

Screenshot (after):

enter image description here

Toto
  • 89,455
  • 62
  • 89
  • 125