Sponsored Content
Top Forums Shell Programming and Scripting Need help on awk to compare only integer on particular column Post 303006433 by RudiC on Thursday 2nd of November 2017 07:20:27 AM
Old 11-02-2017
@RavinderSingh13: seeing the long way you go to account for the units and their respective weight factors, I don't understand why you obviously don't count a value with absent units for "bytes" and a weight of 1E-9 (or 2^-30 for binary values)?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk compare column between 2 files

Hi, I would like to compare file1 and file2 file1 1 2 3 file2 1 a 2 b 3 c 4 d The result should only print out "d" in file 2. Thanks (3 Replies)
Discussion started by: phamp008
3 Replies

2. Shell Programming and Scripting

awk column compare

I've been banging my head against the wall to accomplish the following. Given two files: File a.txt 12345 hello 32324 there File b.txt 12345 stuff 45454 howdy 32324 joe If column 1 matches between the two files, then print only the entire line of the 2nd file (b.txt in this... (3 Replies)
Discussion started by: tiggyboo
3 Replies

3. Shell Programming and Scripting

awk compare column with date format

I have this code to compare columns 1 and 10 between file1 and file 2 and give me all records that match column 1 but dont match column 10 However column 10 is date format mm/dd/yy and awk cant read it and compare ...i tried awk < file1 -F~ '{print $10}' and it gave blank screen Is... (1 Reply)
Discussion started by: sigh2010
1 Replies

4. Shell Programming and Scripting

how to compare string integer with an integer?

hi, how to I do this? i="4.000" if ; then echo "smaller" fi how do I convert the "4.000" to 4? Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies

5. Shell Programming and Scripting

awk compare column n replace with in one file

hi Friends need to compare columns in one file where the data looks like below laptop,IBM phone,samsung car,rental user1,laptop user2,laptop user3,phone want to get output as laptop,IBM phone,samsung car,rental user1,IBM user2,IBM user3,samsung need to seach $2 in array of $1 and... (4 Replies)
Discussion started by: arun1401
4 Replies

6. Shell Programming and Scripting

Compare the second column of a file with the second column of another in awk

Hi, I know that this topic has been discussed in the past and I've tried to follow all the guidelines. Anyhow, I following describe my problem. I have a file (file1 , no. records = 67) containing pairs of IP addresses as follows (with single space as delimiter between the fields): example... (5 Replies)
Discussion started by: amarn
5 Replies

7. 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

8. 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

9. Shell Programming and Scripting

How to compare two column using awk?

Hi team, I have below sample file. It has 4 columns. I want awk script to compare column2 and column4 row by row and print result in new column5 If value matches then result should be MATCHED if not then result should be NOT MATCHED Input file as below UDC_MSISDN,UDC_NPREFIX... (9 Replies)
Discussion started by: shanul karim
9 Replies

10. Shell Programming and Scripting

Need awk or Shell script to compare Column-1 of two different CSV files and print if column-1 matche

Example: I have files in below format file 1: zxc,133,joe@example.com cst,222,xyz@example1.com File 2 Contains: hxd hcd jws zxc cst File 1 has 50000 lines and file 2 has around 30000 lines : Expected Output has to be : hxd hcd jws (5 Replies)
Discussion started by: TestPractice
5 Replies
units(1)						      General Commands Manual							  units(1)

NAME
units - conversion program SYNOPSIS
file] DESCRIPTION
converts quantities expressed in various standard scales to their equivalents in other scales. It works interactively as follows: System Prompt User Response The system responds with two factors; one used if multiplying (preceded by the other if dividing (preceded by After providing the conversion factors, prompts for the next set of values. To terminate press the interrupt character as defined for your login. A quantity is specified as a multiplicative combination of units optionally preceded by a numeric multiplier. Powers are indicated by suf- fixed positive integers, and division by the usual sign: System Prompt User Response The system responds with: only does multiplicative scale changes; thus it can convert Kelvin to Rankine, but not Celsius to Fahrenheit. Most familiar units, abbre- viations, and metric prefixes are recognized, together with a generous leavening of exotica and a few constants of nature including: ratio of circumference to diameter speed of light charge on an electron acceleration of gravity same as Avogadro's number, pressure head per unit height of water, astronomical unit. Units must be provided in lowercase only. is not recognized as a unit of mass; is. Compound names are run together, (e.g., British units that differ from their U.S. counterparts are prefixed thus: For a complete list of units, examine the file: An alternate unit database file can be specified for use with the option. looks in this file rather than the default for the table of con- versions. This must be in the same format as This is useful in defining your own units and conversions. WARNINGS
The monetary exchange rates are out of date. FILES
units(1)
All times are GMT -4. The time now is 09:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy