Sponsored Content
Top Forums Shell Programming and Scripting Need to show highest version line from the list Post 302973052 by Skrynesaver on Friday 13th of May 2016 08:15:08 AM
Old 05-13-2016
Untested but you get the idea...

Code:
ls -R lib/SBSSchemaProject.jar/schemas/ | perl -ne '($schema,$major,$minor)=$_=~/\/(\w+)_v(\d+)_9\d+).xsd$/;if (($major > $max_major)||(($major == $max_major{$schema}) && ($minor>$max_minor{$schema}){$max{$schema}=$_;$max_major{$schema}=$major;$max_minor{$schema}==$minor;}END{for $schema (keys %max){print "$max{$schema}\n";}}' -

This User Gave Thanks to Skrynesaver For This Post:
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Printing highest value from a list

Hi all, I'm trying to get the item with the maximum value, and was wondering if someone can help me with it. Heres my input file: apples 15 books 15 books 17 pens 12 pens 15 umbrella 13Here's what my output file should look like: apples 15 books 17 pens 15 umbrella 13 Can... (2 Replies)
Discussion started by: r4v3n
2 Replies

2. Shell Programming and Scripting

Filtering out duplicates with the highest version number

Hi, I have a huge text file with filenames which which looks like the following ie uniquenumber_version_filename: e.g. 1234_1_xxxx 1234_2_vfvfdbb 343333_1_vfvfdvd 2222222_1_ggggg 55555_1_xxxxxx 55555_2_vrbgbgg 55555_3_grgrbr What I need to do is examine the file, look for... (4 Replies)
Discussion started by: mantis
4 Replies

3. Shell Programming and Scripting

Need to print duplicate row along with highest version of original

There are some duplicate field on description column .I want to print duplicate row along with highest version of number and corresponding description column. file1.txt number Description === ============ 34567 nl21a00is-centerdb001:ncdbareq:Error in loading init 34577 ... (7 Replies)
Discussion started by: vijay_rajni
7 Replies

4. Shell Programming and Scripting

Parse line based on highest value

Hello, Does anyone know how to parse whole line that has highest value in last column (c12), based on the string in column 6 (column VIRUS) INPUT: 5 7 4 8 3 VIRUS1 5 5 HUMAN1 8 4 100 6 9 7 2 6 VIRUS1 6 0 HUMAN2 6 2 80 9 6 7 3 7 VIRUS1 9 7 HUMAN3 5 9 70 8 5 3 8 6 VIRUS2 8 6 HUMAN4 8 6 95... (3 Replies)
Discussion started by: narachaid
3 Replies

5. Shell Programming and Scripting

How to find the X highest values in a list depending on the values of another list with bash/awk?

Hi everyone, This is an exemple of inpout.txt file (a "," delimited text file which can be open as csv file): ID, Code, Value, Store SP|01, AABBCDE, 15, 3 SP|01, AABBCDE, 14, 2 SP|01, AABBCDF, 13, 2 SP|01, AABBCDE, 16, 3 SP|02, AABBCED, 15, 2 SP|01, AABBCDF, 12, 3 SP|01, AABBCDD,... (1 Reply)
Discussion started by: jeremy589
1 Replies

6. Shell Programming and Scripting

Print whole line with highest value from one column

Hi, I have a little issue right now. I have a file with 4 columns test0000002,10030010330,c_,218 test0000002,10030010330,d_,202 test0000002,10030010330,b_,193 test0000002,10030010020,c_,178 test0000002,10030010020,b_,170 test0000002,10030010330,a_,166 test0000002,10030010020,a_,151... (3 Replies)
Discussion started by: Ebk
3 Replies

7. UNIX for Beginners Questions & Answers

awk print line with highest value

grepping on a value but then want to print only those lines that have the highest value in the 4th column log text text R59FJ log text text R63FT log text text R60JX log1 text text R63EA log1 text text R60JX desired output log text text R63FT log1 text text R63EAtried this but not getting... (2 Replies)
Discussion started by: jimmyf
2 Replies
DerivedSchema(3pm)					  LogReport's Lire Documentation					DerivedSchema(3pm)

NAME
Lire::DerivedSchema - Defines a schema for which the records are derived from another schema SYNOPSIS
my $schema = Lire::DlfSchema::load_schema( 'www-user_session' ); my $fields = $schema->fields(); DESCRIPTION
A Lire::DerivedSchema defines a schema for which the records are computed by an analyser using the records of a base schema. An example of a derived schema is the www-user_session schema which computes session information from the records in the www schema. base() Returns the Lire::DlfSchema object from which this schema's records are derived. can_join_schema( $schema ) Returns true if $schema can be joined with this schema. For a DerivedSchema, this will be true only when $schema is an ExtendedSchema of this schema or this schema's base. It is also possible to join the DerivedSchema with its base. AUTHOR
Francis J. Lacoste <flacoste@logreport.org> VERSION
$Id: DerivedSchema.pm,v 1.19 2006/07/23 13:16:28 vanbaal Exp $ COPYRIGHT
Copyright (C) 2001, 2004 Stichting LogReport Foundation LogReport@LogReport.org This file is part of Lire. Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2006-07-23 DerivedSchema(3pm)
All times are GMT -4. The time now is 03:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy