Sponsored Content
Full Discussion: [Solved] Data manipulation
Top Forums Shell Programming and Scripting [Solved] Data manipulation Post 302892001 by CarloM on Monday 10th of March 2014 08:45:11 AM
Old 03-10-2014
You want the highest field 2 value for each unique field 1? (If so, your output data appears to be missing a few rows, e.g. for 335550)

You could do something like:
Code:
awk '{ if ($2 > rates[$1]) { rates[$1]=$2 } } END { for (i in rates) { print i OFS rates[i] } }' aaaa.csv

Note: This does not preserve the ordering or the fixed-width formatting.
This User Gave Thanks to CarloM For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Data Manipulation

Hello I am currently having problems in mapulating a certain file which contains vaious data. Belos is a sample content Event=<3190> Client IP=<151.111.11.143> DNS=<abc.sbc.com> TransCount=<139> Client IP=<150.222.133.163> DNS=<xyz.yuu.com> TransCount=<3734> Event=<3120> Client... (11 Replies)
Discussion started by: khestoi
11 Replies

2. Shell Programming and Scripting

Tricky data manipulation...

Hi everyone.. I am new here, hello.. I hope this doesn't come across to you folks as a stupid question, I'm somewhat new to scripting :) I'm seeking some help in finding a way to manipulate data output for every two characters - example: numbers.lst contains the following output:... (3 Replies)
Discussion started by: explicit
3 Replies

3. Shell Programming and Scripting

Data manipulation from one file

HI all i have a file consisting of following numbers 0000 0000 0000 0000 0000 1010 0000 0100 0000 0000 0000 1111 0000 1010 0000 0100 (3 Replies)
Discussion started by: vaibhavkorde
3 Replies

4. UNIX for Dummies Questions & Answers

[Solved] Column manipulation

Hi Everyone, I was wondering if someone could help me to transform my data into a format I need. Here is an example of what my data looks like E F G H A 1 2 3 4 B 5 6 7 8 C 9 1 2 3 D 4 5 6 7 and this is what I would need it to look like: AE 1 BE 5 CE 9 DE 4 AF 2 BF 6 CF 1 (6 Replies)
Discussion started by: zajtat
6 Replies

5. UNIX for Dummies Questions & Answers

Script for data manipulation

Hi all! my first post here, so mods -- if this should ideally be in the scripts section, please move there. Thanks! I have data in the following format: key1:value1 key2:value2 key3:value3 A B C D key1:value4 key2:value5 key3:value6 A1 B1 key1: ... and so on I want an output... (2 Replies)
Discussion started by: gnat01
2 Replies

6. UNIX for Dummies Questions & Answers

[Solved] Text manipulation help

Hello Unix.com How can I sort from a large email list only the emails that finish with .ca domain? cat <list> | grep "\.ca\b" >> <new list> isnt working perfectly. Any tips? Best regards, Galford D. Weller (2 Replies)
Discussion started by: galford
2 Replies

7. Shell Programming and Scripting

[Solved] awk manipulation of sequentially named files

Hello, I am a very novice user of awk, I have a set of files named file001, file002, file003, file004, etc., each contains four fields (columns of data) separated each by a uneven number of spaces. I want to substitute those spaces by a TAB, so I am using this line of awk script: awk -v OFS="\t"... (4 Replies)
Discussion started by: jaldo0805
4 Replies

8. UNIX for Dummies Questions & Answers

Data manipulation

Hallo Team, I need to manipulate existing data file. Have a look at current data and expected data: Current Data: 27873517141 27873540000 27873515109 27873517140 27873540001 27873540000 27873501343 27873540000 27873517140 27873511292 27873645989 27873540000 27873540000... (7 Replies)
Discussion started by: kekanap
7 Replies

9. UNIX for Dummies Questions & Answers

Data Manipulation

Dear Sir, I have file input RGR001|108.28|-2.86489|100-120|RANGGAR RGR002|108.071|-2.69028|80-100|RANNGAR RGR003|108.168|-2.97053|50-80|RANNGAR RGR007|108.192722222|-2.766138889|0-50|RANGGARI want to create files by joining each rows with each rows below Output as below ... (4 Replies)
Discussion started by: radius
4 Replies

10. Shell Programming and Scripting

Data manipulation, Please help..

Hello, I have a huge set of data that needs to be reformatted. Here is a simple example to explain the process. I have number n=5 and a input with many numbers separated with comma: ... (11 Replies)
Discussion started by: liuzhencc
11 Replies
TCPSPRAY(1)						      General Commands Manual						       TCPSPRAY(1)

NAME
tcpspray - print average throughput for a tcp connection SYNOPSIS
tcpspray [ -v ] [ -e ] [ -h ] [ -b blksize ] [ -n nblks ] [ -f filename ] hostname DESCRIPTION
tcpspray sends data to either the discard or echo TCP service on the specified host and prints the average throughput. OPTIONS
-v Prints a dot for each block sent. Will also print a backspace for each block received in echo mode. Note: the I/O required for this option will affect the throughput rates. -e Use the TCP echo service instead of discard (the default) and print throughput rates for both transmission and reception. -h Print a usage description. -b blksize Sets the size of a block (the internal buffer) in bytes. Defaults to 1024. -n nblks Sets the number of blocks to transfer. Defaults to 100. -f filename Copy the contents of the specified file into the internal buffer (sized by -b option). The buffer is zeroed by default. If the file is larger than the buffer, only the first blksize bytes will be used. If the file is smaller than the buffer, the remaining bytes are zeroed. This option is useful in determining the relationship of the data transferred to throughput. E.g., if data compression is used on any of the intermediate links comprising the TCP connection, preloading the buffer with a text file will produce greater throughput than with a file that has already been compressed. -d delay Sets the time in microseconds to wait between successive buffer transmissions. The default is no delay. SEE ALSO
ping(8), spray(8) AUTHOR
Greg Christy (gmc@quotron.com) 23 October 1991 TCPSPRAY(1)
All times are GMT -4. The time now is 02:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy