Sponsored Content
Top Forums Shell Programming and Scripting Extract lines with unique value using a specific column Post 302860685 by MadeInGermany on Monday 7th of October 2013 04:08:28 AM
Old 10-07-2013
Print lines where the contents of the 9th field is different from the contents of the 6th, 7th, 8th, and 10th fields:
Code:
awk 'BEGIN{field=9} {p=1; for (species=6; species<=10; species++) if (species!=field && $species==$field) p=0} p' file

This User Gave Thanks to MadeInGermany For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to extract first column with a specific character

Hi All, Below is the sample data of my files: O|A|571000689|D|S|PNH|S|SI sadm|ibscml1x| I|A|571000689|P|S|PNH|S|SI sadm|ibscml1x| O|A|571000689|V|S|PNH|S|SI sadm|ibscml1x| S|C|CAM|D|S|PNH|R|ZOA|2004 bscml1x| ... (3 Replies)
Discussion started by: selamba_warrior
3 Replies

2. UNIX for Dummies Questions & Answers

Delete rows with unique value for specific column

Hi all I have a file which looks like this 1234|1|Jon|some text|some text 1234|2|Jon|some text|some text 3453|5|Jon|some text|some text 6533|2|Kate|some text|some text 4567|3|Chris|some text|some text 4567|4|Maggie|some text|some text 8764|6|Maggie|some text|some text My third column is my... (9 Replies)
Discussion started by: A-V
9 Replies

3. UNIX for Dummies Questions & Answers

Extract lines with specific words with addition 2 lines before and after

Dear all, Greetings. I would like to ask for your help to extract lines with specific words in addition 2 lines before and after these lines by using awk or sed. For example, the input file is: 1 ak1 abc1.0 1 ak2 abc1.0 1 ak3 abc1.0 1 ak4 abc1.0 1 ak5 abc1.1 1 ak6 abc1.1 1 ak7... (7 Replies)
Discussion started by: Amanda Low
7 Replies

4. Shell Programming and Scripting

Print unique names in each row of a specific column using awk

Is it possible to remove redundant names in the 4th column? input cqWE 100 200 singapore;singapore AZO 300 400 brazil;america;germany;ireland;germany .... .... output cqWE 100 200 singapore AZO 300 400 brazil;america;germany;ireland (4 Replies)
Discussion started by: quincyjones
4 Replies

5. Shell Programming and Scripting

Print unique names in a specific column using awk

Is it possible to modify file like this. 1. Remove all the duplicate names in a define column i.e 4th col 2. Count the no.of unique names separated by ";" and print as a 5th col thanx in advance!! Q input c1 30 3 Eh2 c10 96 3 Frp c41 396 3 Ua5;Lop;Kol;Kol c62 2 30 Fmp;Fmp;Fmp ... (5 Replies)
Discussion started by: quincyjones
5 Replies

6. Shell Programming and Scripting

Extract values from a specific column to the end

Hello friends, I have a text file with many columns (no. columns vary from row to row) separated by space. I need to collect all the values from 18th column to the end from each line and group them as pairs and then numbering like below.. 1. 18th-col-value 19th-col-value 2. 20th-col-value ... (5 Replies)
Discussion started by: prvnrk
5 Replies

7. Shell Programming and Scripting

Count frequency of unique values in specific column

Hi, I have tab-deliminated data similar to the following: dot is-big 2 dot is-round 3 dot is-gray 4 cat is-big 3 hot in-summer 5 I want to count the frequency of each individual "unique" value in the 1st column. Thus, the desired output would be as follows: dot 3 cat 1 hot 1 is... (5 Replies)
Discussion started by: owwow14
5 Replies

8. Shell Programming and Scripting

ksh sed - Extract specific lines with mulitple occurance of interesting lines

Data file example I look for primary and * to isolate the interesting slot number. slot=`sed '/^primary$/,/\*/!d' filename | tail -1 | sed s'/*//' | awk '{print $1" "$2}'` Now I want to get the Touch line for only the associate slot number, in this case, because the asterisk... (2 Replies)
Discussion started by: popeye
2 Replies

9. Shell Programming and Scripting

Merging two tables including multiple ocurrence of column identifiers and unique lines

I would like to merge two tables based on column 1: File 1: 1 today 1 green 2 tomorrow 3 red File 2: 1 a lot 1 sometimes 2 at work 2 at home 2 sometimes 3 new 4 a lot 5 sometimes 6 at work (4 Replies)
Discussion started by: BSP
4 Replies

10. Shell Programming and Scripting

awk to filter out lines containing unique values in a specified column

Hi, I have multiple files that each contain four columns of strings: File1: Code: 123 abc gfh 273 456 ddff jfh 837 789 ghi u4u 395 File2: Code: 123 abc dd fu 456 def 457 nd 891 384 djh 783 I want to compare the strings in Column 1 of File 1 with each other file and Print in... (3 Replies)
Discussion started by: owwow14
3 Replies
HTML::Microformats::Format::species(3pm)		User Contributed Perl Documentation		  HTML::Microformats::Format::species(3pm)

NAME
HTML::Microformats::Format::species - the species microformat SYNOPSIS
use HTML::Microformats::DocumentContext; use HTML::Microformats::Format::hCard; my $context = HTML::Microformats::DocumentContext->new($dom, $uri); my @objects = HTML::Microformats::Format::species->extract_all( $dom->documentElement, $context); foreach my $species (@objects) { print $species->get_binomial . " "; } DESCRIPTION
HTML::Microformats::Format::species inherits from HTML::Microformats::Format. See the base class definition for a description of property getter/setter methods, constructors, etc. MICROFORMAT
The species documentation at <http://microformats.org/wiki/species> is very sketchy. This module aims to be roughly compatible with the implementation of species in the Operator extension for Firefox, and data published by the BBC and Wikipedia. Here are some brief notes on how is has been impemented: o The root class name is 'biota'. o Important properties are 'vernacular' (alias 'common-name', 'cname' or 'fn'), 'binomial', 'trinomial', 'authority'. o Also recognised are 'class', 'division', 'family', 'genus', 'kingdom', 'order', 'phylum', 'species' and various other ranks. o Because some of these property names are fairly generic, you can alternatively use them in a prefixed form: 'taxo-class', 'taxo-division', etc. o If an element with class 'biota' has no recognised properties within it, the entire contents of the element are taken to be a binomial name. This allows for very simple markup: <i class="biota">Homo sapiens</i> o The meaning of some terminology differs when used by botanists and zoologists. You can add the class 'botany' or 'zoology' to the root element to clarify your usage. e.g. <i class="biota zoology">Homo sapiens</i> An example: <span class="biota zoology"> <i class="binomial"> <span class="genus">Homo</span> <span class="species">sapiens</span> <span class="subspecies">sapiens</span> </i> (<span class="authority">Linnaeus, 1758</span>) a.k.a. <span class="vernacular">Humans</span> </span> RDF OUTPUT
RDF output uses the Biological Taxonomy Vocabulary 0.2 (<http://purl.org/NET/biol/ns#>). BUGS
Please report any bugs to <http://rt.cpan.org/>. SEE ALSO
HTML::Microformats::Format, HTML::Microformats. AUTHOR
Toby Inkster <tobyink@cpan.org>. COPYRIGHT
Copyright 2008-2011 Toby Inkster This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. perl v5.14.2 2011-12-06 HTML::Microformats::Format::species(3pm)
All times are GMT -4. The time now is 05:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy