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
g3cat(1)                                                       mgetty+sendfax manual                                                      g3cat(1)

NAME
g3cat - concatenate multiple g3 documents SYNOPSIS
g3cat [-l] [-a] g3-file1 ... DESCRIPTION
g3cat concatenates g3 files. These can either be 'raw', that is, bitmaps packed according to the CCITT T.4 standard for one-dimensional bitmap encoding, or 'digifax' files, created by GNU's GhostScript package with the digifax drivers. Its output is a concatenation of all the input files, in raw G3 format, with two white lines in between. If a - is given as input file, stdin is used. If the input data is malformed, a warning is printed to stderr, and the output file will have a blank line at this place. OPTIONS
-l separate files with a one-pixel wide black line. -h <blank lines> specifies the number of blank lines g3cat should prepend to each page. Default is 0. -L <lines> limit lenght of output page to maximum <lines> lines. SPECIAL-CASE OPTIONS -w <width> specifies the desired page width in pixels per line. Default is 1728 PELs, and this is mandatory if you want to send the fax to a standard fax machine. If one of the input files doesn't match this line width (for example because it was created by a broken G3 creator), a warning is printed, and the line width is transparently fixed. -a byte-align the end-of-line codes (EOL) in the file. Every EOL will end at a byte boundary, that is, with a 01 byte. -p <pad> specifies a minimum number of bytes that each output line must be padded to. Padding is done with 0-bits before the EOL code. -R suppress output of end-of-page code (RTC). Example The following example will put a header line on a given g3 page, 'page1' and put the result into 'page2': echo '$header' | pbmtext | pbm2g3 | g3cat - page1 >page2 FILES
-- BUGS
Hopefully none :-). SEE ALSO
g32pbm(1), sendfax(8), faxspool(1) AUTHORS
g3cat is Copyright (C) 1993 by Gert Doering, <gert@greenie.muc.de> greenie 27 Oct 93 g3cat(1)
All times are GMT -4. The time now is 02:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy