Monday, April 16, 2012

Use Delimiter In Awk and Cut.

We can use delimiter in Awk, if you exported domain list from godaddy and you want only domain name rather than full information then you can use this command to get domain list only.
Using this:

awk -F "," '{print $1}'

Or

cut '--delimiter= ' -f1

E.g.

cat DomainDownloadList-124696210.csv | awk '{ printf " %s\n", $1 }' | awk -F "," '{print $1}' > domainlist.txt
Or
cat DomainDownloadList-124696210.csv | cut '--delimiter= ' -f1 > domainlist.txt

For word count for counting domain :
cat DomainDownloadList-124696210.csv | awk '{ printf " %s\n", $1 }' | awk -F "," '{print $1}' | wc
Or
cat DomainDownloadList-124696210.csv | cut '--delimiter= ' -f1 | wc




@ Linux Administration Blog.!