The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sorting based on Multiple columns dharmesht Shell Programming and Scripting 15 05-13-2009 11:44 AM
Sorting based on columns MobileUser Shell Programming and Scripting 7 04-11-2007 03:03 PM
sorting data based on multi columns sumeet UNIX for Advanced & Expert Users 2 02-15-2007 12:57 PM
sorting file content on columns marshmallow UNIX for Dummies Questions & Answers 2 01-04-2007 12:10 PM
sorting a file with multiple columns outtacontrol UNIX for Dummies Questions & Answers 3 07-26-2006 02:51 PM

 
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 09-16-2008
labrazil labrazil is offline
Registered User
  
 

Join Date: Sep 2008
Location: San Diego, CA
Posts: 60
sorting file based on two or more columns

Hi gang.

I'm using a unix/mac system and i'm trying to sort a file (more than 1,000,000 lines).


Code:
chr1    100000965       100001001       -
chr1    100002155       100002191       +
chr1    100002165       100002201       +
chr1    100002525       100002561       -
chr1    10000364        10000400        -
chr1    10000372        10000408        -
chr1    10000412        10000448        +
chr1    100004742       100004778       -
chr1    100004767       100004803       +

I want to sort the first column (text and it could be any of 24 chrom) and then sort by 4th column and then by 2nd column.

I tried sort command but when i type in sort +3 +1, it doesn't work.
 

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 07:57 AM.


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