Need help in awk: running a loop with one column and segregate data 4 each uniq value in that field
Hi All,
I have a file like this(having 2 column).
Column 1: like a,b,c....
Column 2: having numbers.
I want to segregate those numbers based on column 1.
Example:
file.
for each value of column 1, these data required.
Output should be like this.
I can do that with help of for loop, but I want to know, how to do this with just AWK.
Last edited by Scott; 01-19-2018 at 08:55 AM..
Reason: Use code tags, please...
Hi all,
I have a file that contains a list of codes (shown below).
I want to 'uniq' the file using only the first field. Anyone know an easy way of doing it?
Cheers,
Dave
##### Input File #####
1xr1 1xws 1yxt 1yxu 1yxv 1yxx 2o3p 2o63 2o64 2o65
1xr1 1xws 1yxt 1yxv 1yxx 2o3p 2o63 2o64... (8 Replies)
Hi ;
I have a question regarding the uniq command in unix
How do I uniq 3rd field in a file ?
original file :
zoom coord 39 18652 39 18652
zoom coord 39 18653 39 18653
zoom coord 39 18818 39 18818
zoom coord 39 18840 39 18840
zoom coord 41 15096 41 15096
zoom... (1 Reply)
Hi,
I have this scenario; where there are two classes:- apple and orange.
1,2,3,4,5,6,apple
1,1,0,4,2,3,apple
1,3,3,3,3,4,apple
1,1,1,1,1,1,orange
1,2,3,1,1,1,orange
Basically for apple, i have 3 entries in the file, and for orange, I have 2 entries. Im trying to edit the file and find... (5 Replies)
How can I use uniq on a certain field or what else could I use? If I want to use uniq on the second field and the output would remove one of the lines with a 5.
bob 5 hand
jane 3 leg
jon 4 head
chris 5 lungs (1 Reply)
Hello all,
this should really be easy for you... I need AWK to print column maxima for each column of such input:
Input:
1 2 3 1
2 1 1 3
2 1 1 2
Output should be:
2 2 3 3
This does the sum, but i need max instead:
{ for(i=1; i<=NF; i++)
sum +=$i }
END {for(i=1; i in sum;... (3 Replies)
I met a challenge to filter ~70 millions of sequence rows and I want using awk with conditions:
1) longest string of each pattern in column 2, ignore any sub-string, as the index;
2) all the unique patterns after 1);
3) print the whole row;
input:
1 ABCDEFGHI longest_sequence1
2 ABCDEFGH... (12 Replies)
I have a flatfile A.txt
2012/12/04 14:06:07 |trees|Boards 2, 3|denver|mekong|mekong12
2012/12/04 17:07:22 |trees|Boards 2, 3|denver|mekong|mekong12
2012/12/04 17:13:27 |trees|Boards 2, 3|denver|mekong|mekong12
2012/12/04 14:07:39 |rain|Boards 1|tampa|merced|merced11
How do i sort and get... (3 Replies)
Hi All,
I am searching for a script which will produce an output file with the uniq first field with the second field having highest value among all the duplicates..
The output file will produce only the uniqs which are duplicate 3 times..
Input file
X 9
B 5
A 1
Z 9
T 4
C 9
A 4... (13 Replies)
so this is what i want to do. i have data that looks like this:
DATA:
Array: A
Interface Type: SAS
Unused Space: 0 MB
Status: Failed
Logical Drive: 2
Size: 279.4 GB
Fault Tolerance: RAID 1
Heads: 255
Sectors Per Track: 32... (2 Replies)
I want to bring values in the second column into single line for uniq value in the first column.
My input
jvm01, Web 2.0 Feature Pack Library
jvm01, IBM WebSphere JAX-RS
jvm01, Custom01 Shared Library
jvm02, Web 2.0 Feature Pack Library
jvm02, IBM WebSphere JAX-RS
jvm03, Web 2.0 Feature... (10 Replies)
Discussion started by: kchinnam
10 Replies
LEARN ABOUT DEBIAN
toshsat1800-irdasetup
TOSHSAT1800-IRDASETUP(1) User Commands TOSHSAT1800-IRDASETUP(1)NAME
toshsat1800-irdasetup - IrDA setup utility for Toshiba Satellite 1800
SYNOPSIS
toshsat1800-irdasetup [options]
DESCRIPTION
IrDA configurator for laptops with ALI1533 bridge (LPC47N227 SuperIO), smc-ircc and not initializing BIOS (tested on Toshiba Satellite
1800-514) to be used with Linux kernel.
OPTIONS -a, --skip-decoding-cfg skip ISA bridge decoding configuration
-b, --skip-smc-ircc-cfg skip SMC-IRCC configuration
-v, --vendor=VALUE look for the specified ISA bridge PCI vendor id
-x, --device=VALUE look for the specified ISA bridge PCI device id
-c, --cfgbase=VALUE set SMC-IRCC IO cfgbase address
-s, --sirbase=VALUE set SMC-IRCC IO sirbase address
-f, --firbase=VALUE set SMC-IRCC IO firbase address
-m, --dma=VALUE set SMC-IRCC DMA channel
-i, --irq=VALUE set SMC-IRCC IRQ
-p, --print print ISA bridge configuration
-h, --help show this help
SEE ALSO
More detailed information in /usr/share/doc/toshset/README.IrDA or online at http://www.csai.unipa.it/peri/toshsat1800-irdasetup/
AUTHOR
toshsat1800-irdasetup was written by Daniele Peri <peri@csai.unipa.it>.
This manual page was written by Roberto C. Sanchez <roberto@connexer.com>, for the Debian project (but may be used by others).
toshsat1800-irdasetup August 2005 TOSHSAT1800-IRDASETUP(1)