Sponsored Content
Top Forums Shell Programming and Scripting awk modify multiple columns with pipes Post 302455041 by bstamper on Monday 20th of September 2010 03:40:43 PM
Old 09-20-2010
Sample input:
Code:
50`Byrd Polar Research Center``<p>Named in honor of one of America's most famous explorers, the Byrd Polar Research Center of The Ohio State University is recognized internationally as a leader in polar and alpine research. The Center's research programs are conducted throughout the world.</p>`12094``|
53`Ornamental Plant Germplasm Center``The OPGC conserves, assesses and distributes herbaceous ornamental plant germplasm and develops new techniques for conserving seed and clonally propagated germplasm.`12493``|
52`Latin American History``<p>Latin American history is well represented in the OSU Department of History with specialists in Colonial Andean, Argentine and Mexican history and Latino/a history. Thematic emphases include economic history, gender and sexuality studies, race and ethnicity, and revolutionary societies. </p>```|
45`Food, Agricultural, and Environmental Sciences, College of```175839``|
49`American Indian Studies at The Ohio State University``<p>American Indian Studies respects the importance of native protocol. We acknowledge that we are in the world on North America, in central Ohio on the traditional homeland of the Shawnee Nation under the guidance of Our Grandmother (Kokumthena), in a refuge of the Delaware under Kishaylamukong, and with the fire of the Wyandots under Ataentsik.  Through them we belong in Ohio. </p><br>```Connect to:<br>
<a href="http://www.americanindianstudies.osu.edu/">American Indian Studies</a>|
33`OSU Newark``<P>OSU Newark offers general studies coursework applicable to all undergraduate degree programs at The Ohio State University. In addition, we offer upper-division courses in several departments. Entire degree programs may be completed at the Newark Campus in several areas.</P>```|

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK subtraction in multiple columns

AWK subtraction in multiple columns Hi there, Can not get the following: input: 34523 934 9485 3847 394 3847 3456 9384 awk 'NR==1 {for (i = 1; i <= NF; i++) {n=$i; next}; {n-=$i} END {print n}' input output: 21188 first column only,... (2 Replies)
Discussion started by: awkward
2 Replies

2. Shell Programming and Scripting

Multiple pipes toward a single awk command

Hello, I would like to pipe two variables into awk, but I don't know how to do. Each variable, "a" and "b", are in fact a list of data. They are not files. So to get awk to work with it I am using: echo $a | awk 'FNR==NR{print $1}FNR!=NR{print $4}' The above works, but when I am... (5 Replies)
Discussion started by: jolecanard
5 Replies

3. Shell Programming and Scripting

Extracting columns from multiple files with awk

hi everyone! I'd like to extract a single column from 5 different files and put them together in an output file. I saw a similar question for 2 input files, and the line of code workd very well, the code is: awk 'NR==FNR{a=$2; next} {print a, $2}' file1 file2 I added the file3, file4 and... (10 Replies)
Discussion started by: orcaja
10 Replies

4. Shell Programming and Scripting

Generating multiple new columns with awk

Hi, I'm trying to reformat a file to create a new columns reflecting the previous 2 over and over. By that I mean currently each observation has two columns and I want to create a third which has a value equal to 1 minus the sum of the previous two. This is slightly complicated as 1) I... (6 Replies)
Discussion started by: reformatplink
6 Replies

5. Shell Programming and Scripting

Awk if-else syntax with multiple columns

I can't seem to get this to work. I can reformat the date field if it's the first field (and only field) in the file: However, I get a syntax error when the date field is the second field (or has any other columns following): I can use a ";" but then it puts each column on separate... (8 Replies)
Discussion started by: giannicello
8 Replies

6. Shell Programming and Scripting

Awk match multiple columns in multiple lines in single file

Hi, Input 7488 7389 chr1.fa chr1.fa 3546 9887 chr5.fa chr9.fa 7387 7898 chrX.fa chr3.fa 7488 7389 chr21.fa chr3.fa 7488 7389 chr1.fa chr1.fa 3546 9887 chr9.fa chr5.fa 7898 7387 chrX.fa chr3.fa Desired Output 7488 7389 chr1.fa chr1.fa 2 3546 9887 chr5.fa chr9.fa 2... (2 Replies)
Discussion started by: jacobs.smith
2 Replies

7. Shell Programming and Scripting

Extracting multiple columns with awk

Hi everyone!! I need to apply a simple command to extract columns from a matrix, but I need to extract contemporary from the first to the tenth columns, than from the eleventh to the twentyth and so on... how can i do that? (1 Reply)
Discussion started by: gabrysfe
1 Replies

8. Shell Programming and Scripting

Awk: is it possible to print into multiple columns?

Hi guys, I have hundreds file like this, here I only show two of them: file 1 feco4_s_BB95.log ZE_1=-1717.5206260 feco4_t_BB95.log ZE_1=-1717.5169250 feco5_s_BB95.log ZE_1=-1830.9322060... (11 Replies)
Discussion started by: liuzhencc
11 Replies

9. Shell Programming and Scripting

Comparing multiple columns using awk

Hello All; I have two files with below conditions: 1. Entries in file A is missing in file B (primary is field 1) 2. Entries in file B is missing in file A (primary is field 1) 3. Field 1 is present in both files but Field 2 is different. Example Content: File A ... (4 Replies)
Discussion started by: mystition
4 Replies

10. Shell Programming and Scripting

Average across multiple columns - awk

Hi forum members, I'm trying to get an average of multiple columns in a csv file using awk. A small example of my input data is as follows: cu,u3o8,au,ag -9,20,-9,3.6 0.005,30,-9,-9 0.005,50,10,3.44 0.021,-9,8,3.35 The following code seems to do most of what I want gawk -F","... (6 Replies)
Discussion started by: theflamingmoe
6 Replies
WHOIS(1)						    BSD General Commands Manual 						  WHOIS(1)

NAME
whois -- Internet domain name and network number directory service SYNOPSIS
whois [-aAbfgiIklmPQrRS] [-c TLD | -h host] [-p port] [--] name ... DESCRIPTION
The whois utility looks up records in the databases maintained by several Network Information Centers (NICs). By default whois starts by querying the Internet Assigned Numbers Authority (IANA) whois server, and follows referrals to whois servers that have more specific details about the query name. The IANA whois server knows about IP address and AS numbers as well as domain names. There are a few special cases where referrals do not work, so whois goes directly to the appropriate server. These include point-of-contact handles for ARIN, nic.at, NORID, and RIPE, and domain names under ac.uk. The options are as follows: -a Use the American Registry for Internet Numbers (ARIN) database. It contains network numbers used in those parts of the world covered neither by APNIC, AfriNIC, LACNIC, nor by RIPE. The query syntax is documented at https://www.arin.net/resources/whoisrws/whois_api.html#nicname -A Use the Asia/Pacific Network Information Center (APNIC) database. It contains network numbers used in East Asia, Australia, New Zea- land, and the Pacific islands. Get query syntax documentation using whois -A help -b Use the Network Abuse Clearinghouse database. It contains addresses to which network abuse should be reported, indexed by domain name. -c TLD This is the equivalent of using the -h option with an argument of "TLD.whois-servers.net". This can be helpful for locating country- class TLD whois servers. -f Use the African Network Information Centre (AfriNIC) database. It contains network numbers used in Africa and the islands of the western Indian Ocean. Get query syntax documentation using whois -f help -g Use the US non-military federal government database, which contains points of contact for subdomains of .GOV. -h host Use the specified host instead of the default. Either a host name or an IP address may be specified. -i Use the traditional Network Information Center (InterNIC) (whois.internic.net) database. This now contains only registrations for domain names under .COM, .NET, .EDU. You can specify the type of object to search for like whois -i 'type name' where type can be domain, nameserver, registrar. The name can contain * wildcards. -I Use the Internet Assigned Numbers Authority (IANA) database. -k Use the National Internet Development Agency of Korea's (KRNIC) database. It contains network numbers and domain contact information for Korea. -l Use the Latin American and Caribbean IP address Regional Registry (LACNIC) database. It contains network numbers used in much of Latin America and the Caribbean. -m Use the Route Arbiter Database (RADB) database. It contains route policy specifications for a large number of operators' networks. -p port Connect to the whois server on port. If this option is not specified, whois defaults to port 43. -P Use the PeeringDB database of AS numbers. It contains details about presence at internet peering points for many network operators. -Q Do a quick lookup; whois will not attempt to follow referrals to other whois servers. This is the default if a server is explicitly specified using one of the other options or in an environment variable. See also the -R option. -r Use the R'eseaux IP Europ'eens (RIPE) database. It contains network numbers and domain contact information for Europe. Get query syntax documentation using whois -r help -R Do a recursive lookup; whois will attempt to follow referrals to other whois servers. This is the default if no server is explicitly specified. See also the -Q option. -S By default whois adjusts simple queries (without spaces) to produce more useful output from certain whois servers, and it suppresses some uninformative output. With the -S option, whois sends the query and prints the output verbatim. The operands specified to whois are treated independently and may be used as queries on different whois servers. ENVIRONMENT
WHOIS_SERVER The primary default whois server. If this is unset, whois uses the RA_SERVER environment variable. RA_SERVER The secondary default whois server. If this is unset, whois will use whois.iana.org. EXIT STATUS
The whois utility exits 0 on success, and >0 if an error occurs. EXAMPLES
To obtain contact information about an administrator located in the Russian TLD domain "RU", use the -c option as shown in the following example, where CONTACT-ID is substituted with the actual contact identifier. whois -c RU CONTACT-ID (Note: This example is specific to the TLD "RU", but other TLDs can be queried by using a similar syntax.) The following example demonstrates how to query a whois server using a non-standard port, where ``query-data'' is the query to be sent to ``whois.example.com'' on port ``rwhois'' (written numerically as 4321). whois -h whois.example.com -p rwhois query-data Some whois servers support complex queries with dash-letter options. You can use the -- option to separate whois command options from whois server query options. A query containing spaces must be quoted as one argument to the whois command. The following example asks the RIPE whois server to return a brief description of its ``domain'' object type: whois -r -- '-t domain' SEE ALSO
Ken Harrenstien and Vic White, NICNAME/WHOIS, 1 March 1982, RFC 812. HISTORY
The whois command appeared in 4.3BSD. BSD
April 25, 2016 BSD
All times are GMT -4. The time now is 04:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy