Find the answer to your Linux question:
Results 1 to 3 of 3
Hi all, I have a file and I need to extract just the website addresses as well as remove duplicates then output the result to a text file: Resolving www.yippee.com ...
  1. #1
    Just Joined!
    Join Date
    Oct 2006
    Posts
    24

    sorting and obtaining specific text patterns

    Hi all,

    I have a file and I need to extract just the website addresses as well as remove duplicates then output the result to a text file:

    Resolving www.yippee.com... failed: Name or service not known.
    Resolving www.yippee.com... failed: Name or service not known.
    Resolving sadpenguin.org... failed: Name or service not known.
    Resolving sadpenguin.org... failed: Name or service not known.
    Resolving www.lada.com... failed: Name or service not known.
    Resolving www.lada.com... failed: Name or service not known.
    Resolving factoryindirect.ca... failed: Name or service not known.
    Resolving factoryindirect.ca... failed: Name or service not known.

    - The things i need to extract are: www.yippee.com, sadpenguin.org, www.lada.com, and factoryindirect.ca

    - any help or suggestions would be awesome. Thanks!

  2. #2
    Linux User
    Join Date
    Aug 2006
    Posts
    458
    you had answers from a previous post of yours. Now, you try to do it yourself first, by at least reading up and practicing.

  3. #3
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Since what you're trying to extract appears to be positional:
    $ awk '{ print $2 }'

    Simple. Then pipe that to sort. Then pipe that to uniq.

    Some reading for you:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...