Sponsored Content
Top Forums Shell Programming and Scripting how to filter files with given format Post 302689465 by esolvepolito on Tuesday 21st of August 2012 11:53:39 AM
Old 08-21-2012
how to filter files with given format

Hi, all, I have files like:
Code:
nameserver 216.66.22.2                           ; tserv1.ash1.ipv6.he.net. tserv13.ash1.ipv6.he.net.
nameserver 216.66.38.58                          ; tserv1.tor1.ipv6.he.net. tserv21.tor1.ipv6.he.net.
nameserver 216.218.221.6                         ; tserv1.hkg1.ipv6.he.net. tserv20.hkg1.ipv6.he.net.
nameserver 216.218.226.238                       ; tserv1.sea1.ipv6.he.net. tserv14.sea1.ipv6.he.net.
nameserver 2001:470:0:470::470                   ; ns1.fmt.he.net. - Filtered
nameserver 2001:470:0:471::471                   ; ns2.fmt.he.net. - Filtered
nameserver 2001:470:0:472::472                   ; ns1.sjc.he.net. - Filtered
nameserver 2001:470:0:473::473                   ; ns1.fmt2.he.net. - Filtered

;
; Cogent
; These servers may not be reachable as Cogent does not have peering with some ISPs and refuses to buy transit.
;
nameserver 2001:978:1:1::d                       ; eu-res1.dns.cogentco.com.
nameserver 2001:978:1:2::d                       ; eu-res2.dns.cogentco.com.
nameserver 2001:978:1:20::1a                     ; res1-fra03-v6.sys.cogentco.com.
nameserver 2001:978:1:22::1a                     ; res1-mad05-v6.sys.cogentco.com.
nameserver 2001:550:1:1::d                       ; na-res1.dns.cogentco.com.
nameserver 2001:550:1:2::d                       ; na-res2.dns.cogentco.com.
nameserver 2001:550:1:2:203:baff:fe2c:c022       ; <unknown>
nameserver 2001:550:1:20::1a                     ; res1-herndon-v6.sys.cogentco.com.
nameserver 2001:550:1:21::2a                     ; res2-herndon-v6.sys.cogentco.com.
nameserver 2001:550:1:22::1a                     ; res1-nyc-v6.sys.cogentco.com.
nameserver 2001:550:1:23::2a                     ; res2-nyc-v6.sys.cogentco.com.
nameserver 2001:550:1:24::1a                     ; res1-chi-v6.sys.cogentco.com.
nameserver 2001:550:1:25::2a                     ; res2-chi-v6.sys.cogentco.com.
nameserver 2001:550:1:26::1a                     ; res1-la-v6.sys.cogentco.com.
nameserver 2001:550:1:27::2a                     ; res2-la-v6.sys.cogentco.com.
nameserver 2001:550:1:27:203:baff:fe2c:c022      ; <unknown>

I want to extract the ipv4 addresses(the format is x.y.z.k) and put them into a new list

how to achieve this? thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Filter only gz files from list of subdirectories

Hi, I have a very big directory structure that consists of many sub-directories inside.There are around 50 ".gz" files under this dir structure. I want to copy all the gz files alone to a seperate location. Plz help me. (2 Replies)
Discussion started by: villain41
2 Replies

2. Shell Programming and Scripting

Filter files and print

Hi, I need to filter and store the files ends with log extension in the array and need to write the file names in the array to a file. I need to use array to derive this solution. Please help me out. Thanks (2 Replies)
Discussion started by: Sekar1
2 Replies

3. UNIX for Dummies Questions & Answers

Search and filter between two files

Hello, I have two files in this form that consist of three columns, a name (L*contig*), the length (length=**) and the sequence LT_file.txt LTcontig1 length=13 acccatgctttta LTcontig5 length=8 ggattacc LTcontig8 length=20 ccattgaccgtacctgatcg LTcontig23 length=5 accta and... (5 Replies)
Discussion started by: FelipeAd
5 Replies

4. Shell Programming and Scripting

Need script for transferring bulk files from one format to text format

"Help Me" Need script for transferring bulk files from one format to text format in a unix server. Please suggest (2 Replies)
Discussion started by: Kranthi Kumar
2 Replies

5. Shell Programming and Scripting

Copying the files after filter

Hi Guys, i want copy the all files another direcotry after filtering the command. and tried as like below...it's not working. ls -ltr|awk '{print $9}'|grep "images\|\.htm"|cp *.* /home/oracle Thanks (13 Replies)
Discussion started by: bmk
13 Replies

6. UNIX for Dummies Questions & Answers

Filter lines common in two files

Thanks everyone. I got that problem solved. I require one more help here. (Yes, UNIX definitely seems to be fun and useful, and I WILL eventually learn it for myself. But I am now on a different project and don't really have time to go through all the basics. So, I will really appreciate some... (6 Replies)
Discussion started by: latsyrc
6 Replies

7. Shell Programming and Scripting

<< Filter and Format the ouput >>

Hi All, I have a output like below $ cat aa.lst Value of output parameters --------------------------------------- Parameter Name : SNAPSHOTTIMESTAMP Parameter Value : 2014-01-07-15.21.50.022423 Parameter Name : DATABASESIZE Parameter Value : 96178176 ... (2 Replies)
Discussion started by: kamauv234
2 Replies

8. UNIX for Dummies Questions & Answers

Filter and merge 2 files problem

Hi, I'm trying to combine two files which have 1 column in common and filter out rows I don't need. File 1: ID Start End Matched Coverage 1 1 254 1515 5.96 2 1 135 402 2.98 File 2 (has 2 rows per entry): >1... (4 Replies)
Discussion started by: Yarinka
4 Replies

9. Shell Programming and Scripting

Filter using awk in CSV files

Hello Gentlemen, Finding difficulties to play with my Input files:confused: . Your guidance will certainly help as always. After converting to csv file from XLSM file, I am getting some extra ""(double quote) characters which I want to terminate inside shell script and process it further. ... (6 Replies)
Discussion started by: pradyumnajpn10
6 Replies

10. Shell Programming and Scripting

Can we filter the below log data into CSV format?

HI , I m looking for help here!!! Can we filter the below log data into CSV format ? timestamp INFO <text > - Some text Drive .. Need a format of separate field such as 1 2 3 4 ... (2 Replies)
Discussion started by: MohSalNiz
2 Replies
rpc.nisd_resolv(1M)					  System Administration Commands				       rpc.nisd_resolv(1M)

NAME
rpc.nisd_resolv, nisd_resolv - NIS+ service daemon SYNOPSIS
rpc.nisd_resolv [-v | -V] [ -F [-C fd]] [-t xx] [-p yy] DESCRIPTION
rpc.nisd_resolv is an auxiliary process which provides DNS forwarding service for NIS hosts requests to both ypserv and rpc.nisd that are running in the NIS compatibility mode. It is generally started by invoking rpc.nisd(1M) with the -B option or ypserv(1M) with the -d option. Although it is not recommended, rpc.nisd_resolv can also be started independently with the following options. This command requires that the /etc/resolv.conf file be setup for communication with a DNS nameserver. The nslookup utility can be used to verify communication with a DNS nameserver. See resolv.conf(4) and nslookup(1M). OPTIONS
-F Run in foreground. -C fd Use fd for service xprt (from nisd). -v Verbose. Send output to the syslog daemon. -V Verbose. Send output to stdout. -t xx Use transport xx. -p yy Use transient program# yy. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWnisu | +-----------------------------+-----------------------------+ SEE ALSO
nslookup(1M), rpc.nisd(1M), resolv.conf(4), attributes(5) NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html. SunOS 5.10 12 Dec 2001 rpc.nisd_resolv(1M)
All times are GMT -4. The time now is 03:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy