|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
split string
if file name such:
ATK_7B1_WIP_20041116160700.9.xml.dat ATK_7B1_WIP_20041116160700.93474039283928384.xml.dat so how can i cut to only get the year,month,day and year and month such:1) 2004 2) 200411 |
|
#2
|
|||
|
|||
|
continue..split string
let say my program such this:
for FILE in ls ATK*.dat do curr_year=$(date +%Y) curr_month=$(date +%Y%m) file_year=<filename just have the year> file_month=<filename that just have year and month> if [ "$curr_year" = "$file_year" ] then if [ 'expr $curr_month - $file_month >= 3 ] then mv $FILE /u006/r45647/Izza/xsltOutput/archiveprocess <move the file to another directory> fi fi done can we use sen to pass the variable for $file_year or file month? or it's easy use the cut only? |
|
#3
|
|||
|
|||
|
Quote:
may kindly invite you; read a shell-prog book! |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > split string |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|