Problem facing to compare different column and print out record with smallest number
Hi,
Input file 1 :
Desired Output file 1 :
Input file 2 :
Desired Output file 2 :
Input file 3 :
Desired Output file 3 :
I would like to print out the record with smallest number through compare the data in column 3 and 4.
If the smallest number are in same column (either column 3 or 4, Input file 2). In that case, I would like to compare the other column and print out the line that record smallest number in both column 3 and 4.
Below is the command that suggested by Subbeh and Klashxx,
It work fine for Input file 1 and Input file 3.
Unfortunately, it won't work for cases like Input file 2.
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)
Hello,
I have often found bash to be difficult when it comes to floating point numbers. I have data with rows of tab delimited floating point numbers. I need to find the smallest number in each row that is not 0.0. Numbers can be negative and they do not come in any particular order for a given... (9 Replies)
Input file
US Score 10
UK Ball 20
AS Score 50
AK Ball 10
PZ Ballon 50
PA Score 70
WT Data 10
.
.
Desired output file
US Score 10
AK Ball 10
WT Data 10
.
. (2 Replies)
Hello,
I am new to Unix and would like to seek a help, please.
I have 2 files (file_1 and file_2), I need to perform the following actions.
1 ) Sort the both file by the column 26-36 (which is Invoice number)
what is sort command with the column sort?
2) Compare the file_1.sorted and... (3 Replies)
Split column data if the table has n number of column's with some record then how to split n number of colmn's line by line with records
Table
---------
Col1 col2 col3 col4 ....................col20
1 2 3 4 .................... 20
a b c d .................... v
... (11 Replies)
Hi,
Anybody know how to print out the record that shown smallest number among column 3 and column 4
Case 1 Input :
37170 37196 77 51
37174 37195 73 52
37174 37194 73 53
Case 1 Output :
37170 37196 77 51
Case 2 Input :
469613 469660 73 ... (4 Replies)
Input file :
5 20
500 2
20 41
41 0
23 1
Desired output :
5
2
20
0
1
By comparing column 1 and 2 in each line, I hope can print out the column with smallest number.
I did try the following code, but it don't look good :( (2 Replies)
Hey. This is pretty easy stuff but I'm learning the basics of Unix at the moment so keep that in mind. I have to:
1) Write a C-shell script to monitor user activity on the server for 13 minutes.
2) Then print the smallest and largest number of users during these 13 minutes.
I have this:
1)... (2 Replies)