Solved

extract 1 topleveldomain type from huge domain textfile

Posted on 2013-11-25
2
140 Views
Last Modified: 2013-11-26
hi

i have a txt file with a huge domainlist (serveral gb) - how can I extract the domains for a specific toplevel domain, eg all .org domains, to another txt file?

file is like this:

blabl.com
test.org
bleble.com
test2.net

etc.

thanks!
0
Comment
Question by:netslt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 39674279
grep ".org *$" inputfile.txt > anotherfile.txt

(only spaces or newline may follow the domain name on its line in the input file).

If there's other stuff following the domain name on a line  you can use "awk":

awk '{E=split($1,A,"."); if(A[E]=="com") print $1}' inputfile.txt > anotherfile.txt
0
 

Author Closing Comment

by:netslt
ID: 39678627
Thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
parallel rsync issues with Ubuntu 1 50
Zimbra and Renewing SSL Certficate 9 61
phpmyadmin memory error 55 94
Cron job never runs on vCenter 6.5 appliance 7 32
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question