There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Tag Cloud
backup bios boot bsod computer connection crash dell driver drivers email error excel firefox freeze hard drive hardware hijackthis internet kb977165 keyboard laptop linksys macro malware network outlook outlook 2003 outlook 2007 password problem realtek recovery router server slow sound toshiba trojan usb video virus vista vpn windows windows 7 windows vista windows xp wireless youtube
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
sort

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
mgonzalo's Avatar
Junior Member with 11 posts.
 
Join Date: Apr 2007
Experience: Beginner
05-Jun-2007, 02:12 AM #1
sort
hello, I have a file that has 3 columns and I want to make a numeric sort with third
column in ascending order.

the file of serious departure (file1).
1 TATE DANCER -12
2 STANISLESS 0
3 UN CAPO 7
4 BABIA -3
5 ZAGATO -2
6 ELDAMAR -10
7 ALABARDERO -7
8 DUDU -8.5
9 OCHO REALES 3
10 CARMENTA -2.5
11 ALBARREAL -6
12 ARNOIA -7
13 RIVALLERO -4
14 VAILLANT PRINCE 4
15 TORCAL -4.5
16 CASTROGONZALO -6
17 BEST SUPER -17
18 THE BREAKERS -13
19 KIZAS -2
20 DANS LES ETOILES -22.5



if I make the sort with these parameters it leaves me

sort -r -k 1.29,1.32 file1

3 UN CAPO 7
14 VAILLANT PRINCE 4
9 OCHO REALES 3
2 STANISLESS 0
8 DUDU -8.5
7 ALABARDERO -7
12 ARNOIA -7
16 CASTROGONZALO -6
11 ALBARREAL -6
15 TORCAL -4.5
13 RIVALLERO -4
4 BABIA -3
20 DANS LES ETOILES -22.5
10 CARMENTA -2.5
5 ZAGATO -2
19 KIZAS -2
17 BEST SUPER -17
18 THE BREAKERS -13
1 TATE DANCER -12
6 ELDAMAR -10

but I would want that this came out.

3 UN CAPO 7
14 VAILLANT PRINCE 4
9 OCHO REALES 3
2 STANISLESS 0
5 ZAGATO -2
19 KIZAS -2
10 CARMENTA -2.5
4 BABIA -3
13 RIVALLERO -4
15 TORCAL -4.5
16 CASTROGONZALO -6
11 ALBARREAL -6
7 ALABARDERO -7
12 ARNOIA -7
8 DUDU -8.5
6 ELDAMAR -10
1 TATE DANCER -12
18 THE BREAKERS -13
17 BEST SUPER -17
20 DANS LES ETOILES -22.5

that options should use in the sort?
Squashman's Avatar
Trusted Advisor with 15,861 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
05-Jun-2007, 10:55 PM #2
Did you try -n
mgonzalo's Avatar
Junior Member with 11 posts.
 
Join Date: Apr 2007
Experience: Beginner
06-Jun-2007, 07:26 AM #3
thank, is -nr
Closed Thread Bookmark and Share   techguy.org/580880

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 01:40 AM.
Copyright © 1996 - 2010 TechGuy, Inc. All rights reserved.
Powered by Cermak Technologies, Inc.