The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Order files by create date mab_arif16 Shell Programming and Scripting 4 05-15-2006 01:04 PM
How do I organize a series of files in date order? hedgehog001 UNIX for Dummies Questions & Answers 1 08-22-2005 11:04 PM
list of files in date order Jeannine UNIX for Dummies Questions & Answers 2 08-15-2005 02:19 PM
Moving Files within a particular date range rooh UNIX for Dummies Questions & Answers 3 03-18-2002 10:59 AM
Moving files based on creation date dgoyea UNIX for Dummies Questions & Answers 1 06-28-2001 05:43 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-10-2008
rebel64 rebel64 is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 1
Sorting Files by date and moving files in date order

I need to build a k shell script that will sort files in a directory where files appear like this "XXXX_2008021213.DAT. I need to sort by date in the filename and then move files by individual date to a working folder. concatenate the files in the working folder then start a process once process is finish then increment by +1 and move the next date to the working folder. Using a AIX box but shortly will be switching to Linux
  #2 (permalink)  
Old 03-11-2008
rikxik's Avatar
rikxik rikxik is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 250
Show your code.
  #3 (permalink)  
Old 03-11-2008
vakharia Mahesh vakharia Mahesh is offline
Registered User
  
 

Join Date: Feb 2007
Posts: 51
Smile 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
Sponsored Links
Closed Thread

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 04:58 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