hi list. supposing i have a directory containing these files:
nat_10-full.xml.afp nat_10.xml.afp nat_1-full.xml.afp nat_1.xml.afp nat_2-full.xml nat_2.xml nat_3-full.xml nat_3.xml nat_4-full.xml nat_4.xml nat_5-full.xml nat_5.xml nat_6-full.xml nat_6.xml nat_7-full.xml nat_7.xml nat_8-full.xml.afp nat_8.xml.afp nat_9-full.xml nat_9.xml you can see that there are some files with dual extensions. my problem is i want to erase all files with dual extensions and re-arrange the array of files in a new order, like so: nat_10-full.xml.afp nat_10.xml.afp --> this was deleted nat_1-full.xml.afp nat_1.xml.afp --> this was deleted nat_2-full.xml nat_2.xml --> this row should become nat_1-full.xml nat_1.xml respectively nat_3-full.xml nat_3.xml --> this row should become nat_2-full.xml nat_2.xml respectively nat_4-full.xml nat_4.xml : nat_5-full.xml nat_5.xml : nat_6-full.xml nat_6.xml : nat_7-full.xml nat_7.xml --> (and so on...) nat_8-full.xml.afp nat_8.xml.afp -->this was deleted nat_9-full.xml nat_9.xml --> this row should become nat_8-full.xml nat_8.xml respectively i did a script that reads a directory and deletes all files with the double extension. <snippet> $ctr=0; foreach (@fileXML) { my $file = "$repository/temp/$fileXML[$ctr]"; if (/afp/) { system ("$file");} $ctr++; } </snippet> but im having problems in renaming the files as described above. how can i do it? ideas? thanks. percy _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]