Sponsored Content
Full Discussion: Grep 5 biggest column
Top Forums Shell Programming and Scripting Grep 5 biggest column Post 302789107 by radius on Wednesday 3rd of April 2013 05:39:31 AM
Old 04-03-2013
Grep 5 biggest column

please help,

file1.txt

Code:
id,week,ict,outgoing_call,blackberry_problem,gprs_problem,sms_problem,flash_problem,sinyal_lemah,blankspot,incoming_call,mms_problem,kualitas_suara,drop_call,data_probl
em,cross_connect,connect_no_voice,vas_problem
,1,sumbagsel,96,127,52,70,28,29,21,18,18,8,5,3,0,0,3
,2,sumbagsel,109,156,80,74,47,47,32,15,24,8,15,4,0,0,4
,3,sumbagsel,123,174,56,65,45,62,28,13,17,7,607,3,1,1,3
,4,sumbagsel,199,190,65,90,40,81,37,21,19,9,15,5,0,1,5
,5,sumbagsel,109,153,58,75,40,42,25,33,22,8,17,4,1,0,4
,6,sumbagsel,97,137,68,56,47,34,27,23,13,8,10,2,1,1,2
,7,sumbagsel,90,105,49,97,54,39,22,17,18,9,7,3,0,1,3
,8,sumbagsel,60,79,43,57,39,35,14,12,11,4,2,2,1,0,2
,9,sumbagsel,58,110,30,44,32,34,13,8,10,3,2,1,1,0,1
,10,sumbagsel,69,61,60,51,8,43,11,12,24,7,5,0,3,2,0
,11,sumbagsel,86,71,50,45,30,22,8,4,11,9,8,3,2,0,3
,12,sumbagsel,75,67,28,50,25,45,10,9,14,5,5,1,1,0,1
,13,sumbagsel,41,50,18,28,24,21,6,7,11,1,5,4,1,0,4

---------- Post updated at 04:34 AM ---------- Previous update was at 04:28 AM ----------

---------- Post updated at 04:39 AM ---------- Previous update was at 04:34 AM ----------

need to sort column based on the latest week (in this week is week=13)

expected output
file2.txt

Code:
       
id,week,ict,blackberry_problem,outgoing_call,sms_problem,flash_problem,sinyal_lemah  
,1,sumbagsel,127,96,70,28,29      
,2,sumbagsel,156,109,74,47,47      
,3,sumbagsel,174,123,65,45,62      
,4,sumbagsel,190,199,90,40,81      
,5,sumbagsel,153,109,75,40,42      
 ,6,sumbagsel,137,97,56,47,34      
,7,sumbagsel,105,90,97,54,39      
,8,sumbagsel,79,60,57,39,35      
,9,sumbagsel,110,58,44,32,34      
,10,sumbagsel,61,69,51,8,43      
,11,sumbagsel,71,86,45,30,22      
,12,sumbagsel,67,75,50,25,45      
,13,sumbagsel,50,41,28,24,21

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

The biggest newb ever...

Hi, all you unix people. I am a pretty advanced windows user, but I am curious about unix. Is there any reason I should attempt to acquire some form of unix for my home computer system? What sort of things is unix useful for? Unix is open source, right? Assuming that to be the case, I infer that... (3 Replies)
Discussion started by: BoneMalone
3 Replies

2. Solaris

top biggest files

hi all, is there any way how i can output the top 10-30 biggest files for all filesystem? using du -sh * is quite tedious since i have to move from 1 directory at a time. thanks (3 Replies)
Discussion started by: 3rr0r_3rr0r
3 Replies

3. Shell Programming and Scripting

finding biggest number

I think my script is working but i am trying to understand while I am tracing to see if it's realli working.. can somebody please comment.. also. is there different way to write this in shell? sh -x findbiggestnum 1 2 3 + big=0 + big=1 + big=2 + big=3 + echo 3 3 big=0 ... (3 Replies)
Discussion started by: hankooknara
3 Replies

4. Shell Programming and Scripting

Top 5 biggest file

Hi , I need to get a list of name and size , of the the top 5 biggest file under the current directory , in decending order Thank You (4 Replies)
Discussion started by: yoavbe
4 Replies

5. HP-UX

Biggest files on FS /

Hi! I'm using Unix HP I'm looking for a command which find the 20 (less or more) biggest files on / but which exclude every other files system Thanks;) (7 Replies)
Discussion started by: Castelior
7 Replies

6. Shell Programming and Scripting

help to get the biggest partition with awk

# fdisk -l /dev/sda Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk... (9 Replies)
Discussion started by: yanglei_fage
9 Replies

7. Shell Programming and Scripting

How to find biggest word in a file....?

With any cmd like sed grep ask etc... (1 Reply)
Discussion started by: sidpatil
1 Replies

8. Shell Programming and Scripting

How to awk or grep the last column in file when date on column contains spaces?

Hi have a large spreadsheet which has 4 columns APM00111803814 server_2 96085 Corp IT Desktop and Apps APM00111803814 server_2 96085 Corp IT Desktop and Apps APM00111803814 server_2 96034 Storage Mgmt Team APM00111803814 server_2 96152 GWP... (6 Replies)
Discussion started by: kieranfoley
6 Replies

9. UNIX for Beginners Questions & Answers

Grep A Column Based On Column Name

I have a file with two columns separated by white space. Dog Cat fido sneaky dopey poptart ears whisker barky herd Trying to list the words under the column named Dog. Tried a few variations of awk but can't... (4 Replies)
Discussion started by: jimmyf
4 Replies

10. Shell Programming and Scripting

Grep values from column 2 in reference of column 1

Gents Is it possible to update the code to get the desired output files from the input list. I called variable to the first column. I need to consider the first column as key to grep the values in the second column according to the desired request. input list (attached ) output1 ... (12 Replies)
Discussion started by: jiam912
12 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 08:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy