Solved

extract 1 topleveldomain type from huge domain textfile

Posted on 2013-11-25
2
135 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
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now