-1

I have a text file which contains URLs. How can I remove duplicated addresses with www, and non www? For example I have two URLs:

example.com
www.example.com

I would like to remove one, or remove 'example.com' from www.example.com then I could remove all www.'s

File contains about 8k urls so I can't do this manually

Urls are separated with new lines, or do it in PHP somehow, explode each to array then compare? (this will be a lot time consuming)

Toto
  • 89,455
  • 62
  • 89
  • 125
user2606353
  • 79
  • 1
  • 8

2 Answers2

1

In Notepad++ search for "www." then replace all with a blank space. Then make a PHP file and explode them into an array, then use array_unique()

andershagbard
  • 1,116
  • 2
  • 14
  • 38
0

I've removed first all www. -> replaced all www. to '' then removed duplicated: Regex: Remove lines containing

Community
  • 1
  • 1
user2606353
  • 79
  • 1
  • 8