On Thu, 22 Aug 2002, Philippe Rousselot wrote:
My modifications are inline:
> mm_aa_xx_yy.jpg at 2720dpi
>
> and I get
>
> aa_mm_xx_yy.jpeg still 2720dpi
>
> and
>
> aa_mm_xx_yy_petit.jpeg with 720x480 resolution
>
> #rename files by changing extension from jpg to jpeg
> cp --preserve "$i" `basename $i jpg`jpeg;
cp --preserve $i ${i%g}eg
[snip]
> for j in *jpeg
> do
>
> #invert month and year
> new=$(echo $j|sed -e \
> 's#^\(.\)\(.\)\(.\)\(.\)\(.\)\(.*\)#\4\5\3\1\2\6#');
> mv $j $new;
if the naming convention is strict enough, ie, if you're sure that
everything is separated by underscores only, and that the size of the
filename is constant, then this would be better:
s#^\([^_]*\)_\([^_]*\)#\2_\1#
if you're sure that each is two characters only, then this is much more
readable:
s#^\(..\)_\(..\)#\2_\1#
Take your pick.
--
Live free or die.
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help