Sponsored Content
Full Discussion: If 2nd column is matched
Top Forums Shell Programming and Scripting If 2nd column is matched Post 302938677 by kenshinhimura on Wednesday 18th of March 2015 11:15:27 AM
Old 03-18-2015
If 2nd column is matched

Both codes not working for me.

Code:
whois nba.com| sed -n '/Registry Registrant ID:/,/Registrant 
whois ymas.com| sed -n '/Registry Registrant ID:/,/Registrant 
whois ymas.com.pt| sed -n '/Registry Registrant ID:/,/Registrant 
whois ymas.com.pt| sed -n '/Registry Admin ID:/,/Admin Email:/p' 
whois ymas.com.pt| sed -n '/Registry Tech ID:/,/Tech Email:/p' > 
whois ymas.com.uy| sed -n '/Registry Registrant ID:/,/Registrant 
whois ymas.com.uy| sed -n '/Registry Admin ID:/,/Admin Email:/p'


Code:
cat aa.sh|awk -F. '$2 == "com|"  {print $0}'
 
cat aa.sh|awk -F. '$2 == "com"  {print $0}'

Desired output
Code:
whois nba.com| sed -n '/Registry Registrant ID:/,/Registrant 
whois ymas.com| sed -n '/Registry Registrant ID:/,/Registrant

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Column matched in two files

I have two files with multiple columns separated by commas. I want to search one column from the first file in the second file; If there is a matching, will append that matched row to the first file. Let me show an example... (unique values in the search column) First file aa,reg1,bb,cc,dd,ff... (6 Replies)
Discussion started by: lalelle
6 Replies

2. Shell Programming and Scripting

Parse 1 column and add 2nd column

I'm racking my brain on this one! :( I have a list like this: Paul 20 Paul 25 Paul 30 Frank 10 Julie 15 Julie 13 etc, etc... I've been trying to figure out a way to have the output display the name in the first column ONCE and add the numbers in the second column and display that... (2 Replies)
Discussion started by: sdlennon
2 Replies

3. Shell Programming and Scripting

Replace data of one column with data on other file corresponding to transaction ID matched

Hi All, I have two files one of which having some mobile numbers and corresponding value whose sample content as follows: 9058629605,8.0 9122828964,30.0 And in second file complete details of all mobile numbers and sample content as follows and delimeter used is comma(,): ... (8 Replies)
Discussion started by: poweroflinux
8 Replies

4. Shell Programming and Scripting

comparing column of two different files and print the column from in order of 2nd file

Hi friends, My file is like: Second file is : I need to print the rows present in file one, but in order present in second file....I used while read gh;do awk ' $1=="' $gh'" {print >> FILENAME"output"} ' cat listoffirstfile done < secondfile but the output I am... (14 Replies)
Discussion started by: CAch
14 Replies

5. Shell Programming and Scripting

1st column,2nd column on first line 3rd,4th on second line ect...

I need to take one column of data and put it into the following format: 1st line,2nd line 3rd line,4th line 5th line,6th line ... Thanks! (6 Replies)
Discussion started by: batcho
6 Replies

6. Shell Programming and Scripting

Calculate 2nd Column Based on 1st Column

Dear All, I have input file like this. input.txt CE2_12-15 3950.00 589221.0 9849709.0 768.0 CE2_12_2012 CE2_12-15 3949.00 589199.0 9849721.0 768.0 CE2_12_2012 CE2_12-15 3948.00 589178.0 9849734.0 768.0 CE2_12_2012 CE2_12-52 1157.00 ... (3 Replies)
Discussion started by: attila
3 Replies

7. Shell Programming and Scripting

Transpose from 2nd column till the last column

Hi I have 5 columns like this a b c d e f g h i j k l m n o From 2nd column till the 5th column of every record, I would like to transpose them as rows, so my output file contains only one row a b c d e f g h i j (9 Replies)
Discussion started by: jacobs.smith
9 Replies

8. Shell Programming and Scripting

Find matched patterns in a column of 2 files with different size and merge them

Hi, i have input files like below:- input1 Name Seq_ID NewID Scores MT1 A0QZX3 1.65 277.4 IVO A0QZX3 1.65 244.5 HPO A0QZX3 1.65 240.5 RgP A0Q3PP 5.32 241.0 GX1 LPSZ3S 96.1 216.9 MEL LPSS3X 4.23 204.1 LDD LPSS3X 4.23 100.2 input2 Fac AddName NewID ... (9 Replies)
Discussion started by: redse171
9 Replies

9. UNIX for Dummies Questions & Answers

How to merge two tables based on a matched column?

Hi, Please excuse me , i have searched unix forum, i am unable to find what i expect , my query is , i have 2 files of same structure and having 1 similar field/column , i need to merge 2 tables/files based on the one matched field/column (that is field 1), file 1:... (5 Replies)
Discussion started by: karthikram
5 Replies

10. Linux

Print the 1st column and the value in 2nd or 3rd column if that is different from the values in 1st

I have file that looks like this, DIP-17571N|refseq:NP_651151 DIP-17460N|refseq:NP_511165|uniprotkb:P45890 DIP-17571N|refseq:NP_651151 DIP-19241N|refseq:NP_524261 DIP-19241N|refseq:NP_524261 DIP-17151N|refseq:NP_524316|uniprotkb:O16797 DIP-19588N|refseq:NP_731165 ... (2 Replies)
Discussion started by: Syeda Sumayya
2 Replies
whois(1)						      General Commands Manual							  whois(1)

NAME
whois - Internet username directory service SYNOPSIS
whois [-h server] name... The whois command looks up user, host, and organization names in the Network Information Center (NIC) database. OPTIONS
Specifies a whois server other than the default server rs.internic.net. DESCRIPTION
The name argument can specify the following: The name of a registered user The name of a registered Internet host The name of some other entity recognized by the whois server By default, the whois command queries the host rs.internic.net. The operands specified to the whois command are concatenated together (separated by white-space) and presented to the whois the server. The default action, unless directed otherwise with a special name is to do a very broad search, looking for matches to name in all types of records and most fields (such as name, nicknames, host name, and network address) in the database. For more information as to what name operands have special meaning, and how to guide the search, use the special name help. EXAMPLES
To display the NIC database entry for the organization osf.org, enter: whois osf.org Open Software Foundation (OSF-DOM) 11 Cambridge Center Cambridge, MAS 02142 Domain Name: OSF.ORG . . . SEE ALSO
DARPA Internet Request for Comment: NICKNAME/WHOIS (RFC 812) whois(1)
All times are GMT -4. The time now is 08:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy