Hi Jim,
Thanks for replying, my case is not sample as mv or cp . I think
.
Okay here is the problem:
In a directory DATA have alot of file name Perform.mmddyyyy.ID.Log where mm is month, dd is day and yyyy is year like Perform.02072006.1234.Log, Perform.02062006.4321.Log, Perform.02082006.4321.Log ...
Each file is a flat file, separate by a pipe like
ID|Location|Date|Hostname|Age|Sex
Then how I write a ksh shell to find all files in DATA directory which are new in the last 2 weeks, and take only 4 fields
ID|Date|Hostname|Age
then write it in a NEWDATA directory, and the file will be named perform-yyyymmdd.dat
Example:
Perform.02062006.4321.Log have
ID|Location|Date|Hostname|Age|Sex
1|SFO|02/06/2006|hawkeye|35|M
2|LAX|02/06/2006|sf49ers|30|M
3|OAK|02/06/2006|goraiders|27|F
4|PIT|02/06/2006|steeler|35|M
and write to a file name perform-20060206.dat
1|02/06/2006|hawkeye|35
2|02/06/2006|sf49ers|30
3|02/06/2006|goraiders|27
4|02/06/2006|steeler|35
How can you do that ? Thanks for sharing your knowlege .