Hi Gurus,
I have a requirement where I have files in a folder
For example in home/input i have files
20080111.06.12.45_abc.xml
20080112.06.10.48_abc1.xml
20080113.06.08.55_abc2.xml
20080114.06.12.35_abc3.xml
Actually i will get the files as abc.xml , i rename & put it with timestamp.
Now i am using a while loop i should check for xmls without timestamp & continue the while loop
i.e., whenever i get a new file suppose abc4.xml, i should run the while loop
Please help me out with sample code
If you mean to find those files not timestamped:
for file in `ls abc*.xml`
do
timestamp=$(date "+%Y%m%d.%H.%M.%S_")
mv $file $timestamp"$file"
done
IF that's what you mean - test this before you run it on real files.
Thanks for reply
Actually in my requirement i had only appended timestamps to the original file.The abc*.xml is an example .
The file name will not be abc...
it may be fff or fahsad any random name.
My idea is just to find the file names which are not starting with 2008 because i am putting timestamp before the file name.
How to get filenames starting with 2008 & put in while loop
while(filename!= 2008)
Can u please help me out with sample code