Sponsored Content
Top Forums Shell Programming and Scripting Cat Values from Several files if it meets criteria for column values Post 302551826 by agama on Wednesday 31st of August 2011 07:35:53 PM
Old 08-31-2011
Try this:

Code:
awk ' /ZIP/ {next;} $NF < .05 { printf( "%s %s\n", $0, FILENAME ); }' *.results >new.file

Adds the filename as the right most column to each output line. Does discards the header lines.

Last edited by agama; 08-31-2011 at 08:36 PM.. Reason: oops -- added redirection of output
This User Gave Thanks to agama For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to pick values from column based on key values by usin AWK

Dear Guyz:) I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z). I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)
Discussion started by: repinementer
16 Replies

2. Shell Programming and Scripting

Awk: Summing values with group criteria

Hi Guys, I have a text file with ";" like separator F1;F2;F3;F4;F5 444;100041;IT;GLOB;1800000000 444;100041;TM;GLOB;1000000000 444;10300264;IT;GLOB;2000000000 444;10300264;IT;GLOB;2500000000 I have to sum the cullums F5 for same F2 and F3 collums The result must be: ... (7 Replies)
Discussion started by: gianluca2
7 Replies

3. Shell Programming and Scripting

print unique values of a column and sum up the corresponding values in next column

Hi All, I have a file which is having 3 columns as (string string integer) a b 1 x y 2 p k 5 y y 4 ..... ..... Question: I want get the unique value of column 2 in a sorted way(on column 2) and the sum of the 3rd column of the corresponding rows. e.g the above file should return the... (6 Replies)
Discussion started by: amigarus
6 Replies

4. UNIX for Dummies Questions & Answers

shift values in one column as header for values in another column

Hi Gurus, I have a tab separated text file with two columns. I would like to make the first column values as headings for the second column values. Ex. >value1 subjects >value2 priorities >value3 requirements ...etc and I want to have a file >value1 subjects >value2 priorities... (4 Replies)
Discussion started by: Unilearn
4 Replies

5. Shell Programming and Scripting

Compare values in two files. For matching rows print corresponding values from File 1 in File2.

- I have two files (File 1 and File 2) and the contents of the files are mentioned below. - I am trying to compare the values of Column1 of File1 with Column1 of File2. If a match is found, print the corresponding value from Column2 of File1 in Column5 of File2. - I tried to modify and use... (10 Replies)
Discussion started by: Santoshbn
10 Replies

6. Shell Programming and Scripting

Converting odd values to even values(or vice-versa) located in a column

Hello All, I have a below data in a .csv file where all rows where col1 is A, col2 is odd numbers, similarly even numbers for all rows where col1 is B. Note that my data has some other columns(not shown here) too (around 100) after col2. Tool,Data A,1 A,3 A,5 .... so on B,2 B,4 .... ... (4 Replies)
Discussion started by: ks_reddy
4 Replies

7. Shell Programming and Scripting

Query the table and return values to shell script and search result values from another files.

Hi, I need a shell script, which would search the result values from another files. 1)execute " select column1 from table_name" query on the table. 2)Based on the result, need to be grep from .wft files. could please explain about this.Below is the way i am using. #!/bin/sh... (4 Replies)
Discussion started by: Rami Reddy
4 Replies

8. Shell Programming and Scripting

Convert Column Values to a Range of Values

I have a list of columns with values that I need to transform into a row containing the range of each column. For example: "Column A" 1 2 3 4 10 12 14 15 16 17 18 "Column B" 1 4 5 6 (4 Replies)
Discussion started by: newbio
4 Replies

9. Shell Programming and Scripting

Compare two files column values using awk

Judi # cat File1 judi /export/home 76 judi /usr 83 judi # judi # cat File2 judi /export/home 79 judi /usr 82 judi # if COLUMN3 of File2 is greater that COLUMN3 of File1, then print File2's lines juid /export/home 79 Code tags please (2 Replies)
Discussion started by: judi
2 Replies

10. Shell Programming and Scripting

Only print specific xml values that meet two criteria in python

I have a large XML file that I want to parse, and only print one specific value if two values are met. This is the code so far: #!/usr/local/bin/python import xml.etree.ElementTree as ET tree = ET.parse('onedb-dhcp.xml') root = tree.getroot() # This successfully gets all... (1 Reply)
Discussion started by: brianjb
1 Replies
Net::Trac::TicketSearch(3pm)				User Contributed Perl Documentation			      Net::Trac::TicketSearch(3pm)

NAME
Net::Trac::TicketSearch - A ticket search (custom query) in Trac SYNOPSIS
my $search = Net::Trac::TicketSearch->new( connection => $trac ); $search->query( owner => 'hiro', status => { 'not' => [qw(new reopened)] }, summary => { 'contains' => 'yatta!' }, reporter => [qw( foo@example.com bar@example.com )] ); print $_->id, " " for @{$search->results}; DESCRIPTION
This class allows you to run ticket searches on a remote Trac instance. ACCESSORS
connection limit [NUMBER] Get/set the maximum number of results to fetch. Default is 500. This may also be limited by the Trac instance itself. results Returns an arrayref of Net::Trac::Tickets for the current query. url Returns the relative URL for the current query (note the format will be CSV). METHODS
query [PARAMHASH] Performs a ticket search with the given search conditions. Specify a hash of "column =" value> pairs for which to search. Values may be a simple scalar, a hashref, or an arrayref. Specifying a hashref allows you to select a different operator for comparison (see below for a list). An arrayref allows multiple values to be or'd for the same column. Unfortunately Trac has no way of anding multiple values for the same column. Valid operators are "is" (default), "not", "contains", "lacks", "startswith", and "endswith". Returns undef on error and the results otherwise. LICENSE
Copyright 2008-2009 Best Practical Solutions. This package is licensed under the same terms as Perl 5.8.8. perl v5.12.3 2009-05-27 Net::Trac::TicketSearch(3pm)
All times are GMT -4. The time now is 02:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy