>> so i need for each unique key (there are more then one) the news file will remain
I don't get what exactly you want to do..May be you could have been more clear !!
Well the following script extracts each field (key and date-time) from the file name..
Code:
#!/bin/bash
ext=".3gp" #put the file extension here
for f in *.3gp #repeats of for each file in the directory
do
#extract the filename without extension
base=`basename $f $ext`
echo $base
#extract the prefix
pref=`echo $base | cut -c 5-13 -`
echo $pref
#extract date and time
dtime=`echo $base | cut -c 14-25 -`
echo $dtime
done
Recent comments
1 day 17 hours ago
2 days 2 hours ago
2 days 5 hours ago
2 days 6 hours ago
2 days 8 hours ago
2 days 9 hours ago
2 days 11 hours ago
2 days 12 hours ago
3 days 4 hours ago
3 days 5 hours ago