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
ISDND.RATES(5)						      BSD File Formats Manual						    ISDND.RATES(5)

NAME
isdnd.rates -- isdn4bsd ISDN management daemon rates description file DESCRIPTION
The file isdnd.rates contains descriptions how long charging units last at a given time of day, day of week and the distance to the destina- tion. If this file is available, this information may be used by the isdnd(8) ISDN connection management daemon to calculate the short hold time for a connection. The format of a rate entry line is as follows: The first field, the (rate-code) defines a collection of rates (for each day of the week) which can be referenced in the isdnd(8) configura- tion file isdnd.rc(5). This field must start with the identifier ``ra'' followed by a digit in the range of zero to four. The second field, the (day-number) selects the day of week for which this entry defines the rates, where 0 stands for Sunday, 1 for Monday and so on until the digit 6 which stands for Saturday. The rest of the line consists of one or more space separated fields which have the following syntax: start_hour.start_minutes-end_hour.end_minutes:charge_unit_length Start_hour and start_minutes define the begin of a time section and end_hour and end_minutes define the end. Charge_unit_length define the length of a charging unit in the previously defined time section. No spaces or tabs are allowed inside this field. The hour and minutes specifications MUST have exactly 2 digits, in case just one digit is needed, a leading 0 must be used. For example, 14.00-18.00:90 defines, that between 2:00 PM and 6:00 PM the length of one charging unit lasts 90 seconds. FILES
/etc/isdn/isdnd.rates The default rates specification file for the isdnd ISDN daemon. EXAMPLES
The line: ra0 0 00.00-05.00:240 05.00-21.00:150 21.00-24.00:240 defines the unit lengths for a Sunday. SEE ALSO
isdnd.rc(5), isdnd(8) AUTHORS
The rates subsystem for the isdnd(8) daemon to which isdnd.rates belongs was designed and written by Gary Jennejohn. The isdnd(8) daemon and this manual page were written by Hellmuth Michaelis <hm@kts.org>. BSD
September 11, 1998 BSD
All times are GMT -4. The time now is 11:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy