<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Morning all, apologies for the delay in getting back on this.<br>
<br>
Thanks very much for the replies.<br>
<br>
I managed to find a line that worked to rename the files as I wanted which is, <font color="#ff0000">
rename -v "s/^OUT???-????????-??????-//g" *.gsm</font>
<div><font color="#ff0000"><br>
</font></div>
<div>The problem i have now is that running that on the actual folder gives me an Argument list too long error.</div>
<div><br>
</div>
<div>When i copy files between these folders i use the line <font color="#ff0000">find -iname * -exec cp -v {} /temp/. \; </font>so that i am essentially copying one file at a time.</div>
<div><br>
</div>
<div>I have been trying to combine my 2 examples to complete my bulk rename but so far without much success. Any help would be appreciated.</div>
<div><br>
</div>
<div>Thanks again</div>
<div><br>
</div>
<div>Rob</div>
<div><font color="#ff0000"><br>
</font></div>
<div><font color="#ff0000"><br>
</font></div>
<div><br>
________________________________________<br>
From: watford-bounces@mailman.lug.org.uk [watford-bounces@mailman.lug.org.uk] on behalf of Alain Williams [addw@phcomp.co.uk]<br>
Sent: 28 November 2012 00:44<br>
To: watford@mailman.lug.org.uk<br>
Subject: Re: [Watford] Bulk Rename Files<br>
<br>
On Tue, Nov 27, 2012 at 11:43:05PM +0000, Rob Jefferis wrote:<br>
> Hi guys, I have a load of files in a directory with file names similar to below<br>
><br>
> OUT119-20120702-084956-1341215396.177198.gsm<br>
><br>
> It is basically OUT(dialingextensionnumber)-DATE-TIME-UNIQUEID.gsm<br>
><br>
> I would like to somehow bulk rename all the files in this folder to strip everything other than the uniqueid.gsm bit<br>
><br>
> So in this case I want the file to end up called<br>
><br>
> 1341215396.177198.gsm<br>
><br>
><br>
> Is there a quick way to do this?<br>
<br>
Using ksh<br>
<br>
for file in *.gsm<br>
do mv $file ${file#~(E:+(OUT+(\d)-+(\d)-+(\d)-))}<br>
done<br>
<br>
The syntax is a little strange.<br>
<br>
--<br>
Alain Williams<br>
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.<br>
+44 (0) 787 668 0256 http://www.phcomp.co.uk/<br>
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php<br>
#include <std_disclaimer.h><br>
<br>
_______________________________________________<br>
Watford mailing list<br>
Watford@mailman.lug.org.uk<br>
https://mailman.lug.org.uk/mailman/listinfo/watford<br>
<br>
</div>
</div>
</body>
</html>