Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I have a file in the format: *@domain1.com*@domain2.com*@domain3.com etc. I want to print out this file with domain1.com domain2.com etc on a new line so I can do something ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2006
    Posts
    2

    File processing question


    Hi, I have a file in the format:

    *@domain1.com*@domain2.com*@domain3.com

    etc.

    I want to print out this file with domain1.com domain2.com etc on a new line so I can do something like ./script >> domains.new
    and have each domain on a separate line.

    I've tried fiddling with awk, grep and perl to achieve this but my programming skills are lacking and can't seem to do it.

    Can someone help?

    Thanks!

  2. #2
    Linux Enthusiast
    Join Date
    Jun 2005
    Posts
    668
    Code:
     echo "*@domain1.com*@domain2.com*@domain3.com" | tr --delete "@" | tr "*" "\n" > domains.new
    not perfect, but it works

  3. #3
    Just Joined!
    Join Date
    Apr 2006
    Posts
    2
    You're a star! Thank 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
  •