![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Order files by create date | mab_arif16 | Shell Programming and Scripting | 4 | 05-15-2006 10:04 AM |
| How do I organize a series of files in date order? | hedgehog001 | UNIX for Dummies Questions & Answers | 1 | 08-22-2005 08:04 PM |
| list of files in date order | Jeannine | UNIX for Dummies Questions & Answers | 2 | 08-15-2005 11:19 AM |
| Moving Files within a particular date range | rooh | UNIX for Dummies Questions & Answers | 3 | 03-18-2002 06:59 AM |
| Moving files based on creation date | dgoyea | UNIX for Dummies Questions & Answers | 1 | 06-28-2001 02:43 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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
|
| Forum Sponsor | ||
|
|
|
|||
|
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 |
|||
| Google UNIX.COM |