The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Sorting Files by date and moving files in date order
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
Sorting Files by date and moving files in date order
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
03-11-2008
vakharia Mahesh
Registered User
Join Date: Feb 2007
Posts: 51
sort by date
You can use sort -k1.??(starting field no),ending filed no.
say for example for your date XXXX_2008021213.DAT to sort this on year
mth and date order you can use
sort -k1.6,1.9 -k1.10,1.11 -k1.12,1.13 input_file > output file
Cheer up
vakharia Mahesh
View Public Profile
Find all posts by vakharia Mahesh