The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Remove lines, Sorted with Time based columns using AWK & SORT karthikn7974 Shell Programming and Scripting 1 05-10-2008 12:04 AM
sort columns by field kamel.seg Shell Programming and Scripting 4 02-20-2008 06:50 AM
add columns from file to another and sort kamel.seg Shell Programming and Scripting 12 12-12-2007 02:39 PM
Help needed to sort multiple columns in one file ahjiefreak UNIX for Dummies Questions & Answers 1 12-07-2007 05:50 AM
Row to Columns vskr72 UNIX for Dummies Questions & Answers 4 03-21-2007 09:53 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-10-2004
murbina murbina is offline
Registered User
  
 

Join Date: May 2004
Location: Mexico City
Posts: 4
Sort by Columns

Hello, I am new in UNIX

I am looking for a instrction to sort a file by columns 6,25 and 41

this is what I tried but not getting the correct result:

sort -t= -k1.6,1.25,1.41 to_sort.txt > sorted.txt
I used -t= just to get the whole line as one field.

INVS80993596SUM994338602XX 000000060 EA FP
INVS80993596SUM994338603CC 000000060 EA FP
INVS80993596SUM994338605AA 000000060 EA FP
INVS80993596SUM994338606BB 000000060 EA FP

This is the desired result:

INVS80993596SUM994338605AA 000000060 EA FP
INVS80993596SUM994338606BB 000000060 EA FP
INVS80993596SUM994338603CC 000000060 EA FP
INVS80993596SUM994338602XX 000000060 EA FP

But since 994338602 is small I get this which is wrong:

INVS80993596SUM994338602XX 000000060 EA FP
INVS80993596SUM994338603CC 000000060 EA FP
INVS80993596SUM994338605AA 000000060 EA FP
INVS80993596SUM994338606BB 000000060 EA FP


Do you know what should I put in my sort command?
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:01 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0