Kindly Help regarding sorting a file rows


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Kindly Help regarding sorting a file rows
# 1  
Old 07-25-2012
Question Kindly Help regarding sorting a file rows

Dear All,

I have a file name exporting.txt. Below is the content.

Code:
$ cat exporting.txt
. . exporting table                         DT_BCD                         63716            rows     exported
. . exporting table                         DT_CVD                         36321            rows     exported
. . exporting table                        DT_NOTN                       1588              rows     exported
. . exporting table                   DT_NOTN_SLNO     168769          rows     exported
. . exporting table                         DT_RSP                            6103              rows     exported
. . exporting table                         DT_NCD                    147                rows      exported
. . exporting table                    DT_ANTIDUMP           118608           rows     exported
. . exporting table                     D_CNTRY_CD                  244                rows     exported

I want to sort the rows of the rows according to the numeric column (6th) in ascending order.

Kindly Help.

Thanks
Bhaskar

Last edited by methyl; 07-25-2012 at 10:25 AM.. Reason: please user code tags
# 2  
Old 07-25-2012
try this.....

Code:
sort -nrk6

This User Gave Thanks to pamu For This Post:
# 3  
Old 07-25-2012
Thanks a lot. It's Working. SmilieSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Moving or copying first rows and last rows into another file

Hi I would like to move the first 1000 rows of my file into an output file and then move the last 1000 rows into another output file. Any help would be great Thanks (6 Replies)
Discussion started by: kylle345
6 Replies

2. UNIX for Dummies Questions & Answers

Sorting rows to columns

Dear all, I need your help to sort out a file with more then 15, 000 rows, input file has following format : AT4560 GO:1289GO:8915GO:9243GO:5739GO:6757GO:9245GO:9507output should be like: AT4560 GO:1289 AT4560 GO:8915 AT4560 GO:9243 AT4560 GO:5739 AT4560 GO:6757 AT4560 GO:9245... (5 Replies)
Discussion started by: AAWT
5 Replies

3. UNIX for Dummies Questions & Answers

merging rows into new file based on rows and first column

I have 2 files, file01= 7 columns, row unknown (but few) file02= 7 columns, row unknown (but many) now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there e.g. file 01 James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies

4. Post Here to Contact Site Administrators and Moderators

kindly move thread

kindly move this thread: https://www.unix.com/unix-dummies-questions-answers/176868-get-all-strings-after-equal-sign.html to Shell Programming and Scripting...created in wrong forum... thanks!!! (0 Replies)
Discussion started by: h0ujun
0 Replies

5. Shell Programming and Scripting

delete rows in a file based on the rows of another file

I need to delete rows based on the number of lines in a different file, I have a piece of code with me working but when I merge with my C application, it doesnt work. sed '1,'\"`wc -l < /tmp/fileyyyy`\"'d' /tmp/fileA > /tmp/filexxxx Can anyone give me an alternate solution for the above (2 Replies)
Discussion started by: Muthuraj K
2 Replies

6. Shell Programming and Scripting

kindly help me out on this please

Hello experts, please help me on this. This is the scenario: I have applications like BigBrother,PowerKeeper/PowerBroker etc.. which I have to install during server build for both AIX and Solaris. I already have separate installation scripts for both OS for all applications. Now, I want to... (0 Replies)
Discussion started by: solaix14
0 Replies

7. Shell Programming and Scripting

Kindly help : sort

Iam new to Unix ....analyzing the code Can any one pls explain what does it mean by below code sort +0 -1 +1 -2 +2 -3n +3 -4n +4 -5n file.txt -o awaiting for reply ..... (1 Reply)
Discussion started by: charandevu
1 Replies

8. Shell Programming and Scripting

Can someone kindly help with appending problem!!!

Hi guys,i urgently need help in this problem,i need to append one sentence to another line when it meet a certain word. For example: root: root time_last_login = 1191232080 root tty_last_login = /dev/vty0 root host_last_login = rep1nim root unsuccessful_login_count = 0 root... (10 Replies)
Discussion started by: cyberray
10 Replies

9. Shell Programming and Scripting

FOR loop problem: Kindly Help

Hello Friends, I have file called reference.txt which looks like below, columns are been formed by delimiter "|" as shown. I am required to scan whole file line by line & compare 1st 2 columns with new name (ex. ferrari) & new version (2.1). CODE PURPOSE: whnever new project formed... (6 Replies)
Discussion started by: okdev
6 Replies
Login or Register to Ask a Question