sorting options


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers sorting options
# 1  
Old 09-13-2006
sorting options

Hi i have file which looks like this.....

1:N
2:Y
2:N
1:Y

i need the output as
1:Y
1:N
2:Y
2:N

how can i achive this using sort command
# 2  
Old 09-13-2006
sort -kn1.1 -kr1.3 file
# 3  
Old 09-14-2006
thanks for reply

i have a file
1:Y
5:N
5:Y
3:N
3:Y
2:Y
6:Y
2:Y
4:N
4:Y
3:N

and i am using command "sort -t":" -k1,1 -kr 1,2 sorttest" to sort the first field and second fiels in reverse direction...
field 1 and 2 are the keys bit it is giving error

sort: invalid number at field start: invalid count at start of `r'

can any body help me in this regard
# 4  
Old 09-14-2006
Code:
sort -t":" -k1,1 -kr1,2 sorttest

remove the space between r and 1
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

bad options(s)

Hi Folks, I am seeing an issue in solaris, while running a script.. Script contents #!/usr/bin/bash echo $HOME echo "********** RUNNING props on test ********" . /opt/home/weblogic/.profile > /dev/null echo "****** CURRENT BRANCH: $BRANCH *********"; .... (3 Replies)
Discussion started by: ganga.dharan
3 Replies

2. Ubuntu

Kernel boot options removed by fault, no boot options

Hello Everyone, First of all, I highly appreciate all Linux forum members and whole Linux community. http://forums.linuxmint.com/images/smilies/icon_wink.gif. I wish you the best for all of you ! I will try to be short and concise: I am using Linux Mint 10 for 2 months on 2 ws, and all went... (3 Replies)
Discussion started by: cdt
3 Replies

3. UNIX for Dummies Questions & Answers

remsh options

Hi All, I want to know all the options that are used for command remsh. And also the prerequisites like entries in .rhosts file. Can anybody share the link or document? thanks. (1 Reply)
Discussion started by: AB10
1 Replies

4. Programming

Help with TCP Options in C

Hello everybody, It's me again, i need your help! I was almost finishing a program when it crashed, because of TCP segments with the TCP Options enabled. I am able to control every field of every packet i receive, except of those using TCP Options. Is there a way to determine if a packet is... (0 Replies)
Discussion started by: Zykl0n-B
0 Replies

5. AIX

no options

Hi All, I have a situation here that's very fun... I have a system with AIX and iPlanet (sunOne) installed, when occurs an unknown event on the network the WebServer shows a thousand of CLOSE_WAIT connections and this number grows and grows until the webserver crashs. I read some documents... (2 Replies)
Discussion started by: nascimento.rp
2 Replies

6. Post Here to Contact Site Administrators and Moderators

Advt Options ?

Hi, I was wondering if you accept advertising on your site ? Regards, (1 Reply)
Discussion started by: systemali
1 Replies

7. UNIX for Dummies Questions & Answers

options

I am just beginning to learn unix and I was wondering if there was a list of all the options somewhere on the net or hidden in the man pages? Also do options always have - and then a letter, or can it be - and a number as well? Thanks! (1 Reply)
Discussion started by: terms5
1 Replies

8. UNIX for Dummies Questions & Answers

cp options

Hello again, Is there an option for the cp command to overwrite existing files in the destination directory? Cheers Rob (3 Replies)
Discussion started by: milage
3 Replies
Login or Register to Ask a Question