The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-16-2008
mrodrig mrodrig is offline
Registered User
 

Join Date: May 2008
Posts: 8
Exclamation Sort file alphabetically AND numerically

Hi all.
I have 2 files like this:

f1
A 10
B 80
C 9

f2
A 11
B 700
C 10

What I want is the concatenation of the two files sorted by name (alphabetically) and size (numerically), so the result should be like this:

F3 (cat f1 f2 sorted)
A 10
A 11
B 80
B 700
C 9
C 10

but the result I get when I do sort f1 f2 is:

A 10
A 11
B 700
B 80
C 10
C 9

Thanks for your help.
Reply With Quote
Forum Sponsor