Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Compare values in multiple rows in one column using awk Post 303043945 by RudiC on Tuesday 11th of February 2020 04:19:50 PM
Old 02-11-2020
Please be way more specific. What does "where the different is > 1" mean? How does this show up in your desired output? Which of the four lines should be printed? In your attempt, you reference $10 which doesn't exist in your input sample, and only in the first line, although empty, in your desired output.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (1 Reply)
Discussion started by: yerruhari
1 Replies

2. UNIX for Dummies Questions & Answers

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (1 Reply)
Discussion started by: yerruhari
1 Replies

3. Shell Programming and Scripting

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (3 Replies)
Discussion started by: yerruhari
3 Replies

4. Shell Programming and Scripting

How to compare the values of a column in awk in a same file and consecutive lines..

I would like to compare the values of 2nd column of consecutive lines of same file in such a way so that if the difference between first value and second value is more than 100 it should print complete line else ignore line. Input File ========== PDB 2500 RTDB 123 RTDB-EAGLE 122 VSCCP 2565... (4 Replies)
Discussion started by: manuswami
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. UNIX for Dummies Questions & Answers

Compare values of fields from same column with awk

Hi all ! If there is only one single value in a column (e.g. column 1 below), then return this value in the same output column. If there are several values in the same column (e.g. column 2 below), then return the different values separated by "," in the output. pipe-separated input: ... (11 Replies)
Discussion started by: lucasvs
11 Replies

7. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

8. Shell Programming and Scripting

How to compare the values of a column in a same file using awk?

Dear Unix experts, I have got a file where I would like to compare the values of second column if first column is same in such a way that the difference between the values is >50. If not, I would like to discard both values. For example, my input file looks like - comp275_c0_seq2 73... (7 Replies)
Discussion started by: utritala
7 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
Alzabo::Runtime::InsertHandle(3pm)			User Contributed Perl Documentation			Alzabo::Runtime::InsertHandle(3pm)

NAME
Alzabo::Runtime::InsertHandle - A handle representing an insert SYNOPSIS
my $handle = $table->insert_handle ( columns => [ $table->columns( 'name', 'job' ) ] ); my $faye_row = $handle->insert( values => { name => 'Faye', job => 'HK Pop Chanteuse' } ); my $guesch_row = $handle->insert( values => { name => 'Guesch', job => 'French Chanteuse and Dancer' } ); DESCRIPTION
This object is analogous to a DBI statement handle, and can be used to insert multiple rows into a table more efficiently than repeatedly calling "Alzabo::Runtime::Table->insert()". METHODS
Objects of this class provide one public method: insert This method is used to insert a new row into a table. It accepts the following parameters: * values This should be a hash reference containing the values to be inserted into the table. If no value is given for a primary key column and the column is "sequenced" then the primary key will be auto-generated. If values are not provided for other columns which were given when "Alzabo::Runtime::Table->insert_handle" was called, this method first checks to see if a value was provided for the column when "Alzabo::Runtime::Table->insert_handle" was called. If none was pro- vided, then the column's default value is used. If column values were passed to "Alzabo::Runtime::Table->insert_handle", then these can be overridden by values passed to this method. It is not possible to override column values that were given as SQL functions when "Alzabo::Runtime::Table->insert_handle" was called. This method returns a new "Alzabo::Runtime::Row" object. Throws: "Alzabo::Exception::Logic", "Alzabo::Exception::Params" perl v5.8.8 2007-12-23 Alzabo::Runtime::InsertHandle(3pm)
All times are GMT -4. The time now is 09:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy