<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;">Thanks Steve, that is pretty much what I have been trying but for some reason I still get the error argument list too long. hmmmmm
<div><br>
</div>
<div>Thanks</div>
<div><br>
</div>
<div>Rob<br>
<div><br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF412518" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> watford-bounces@mailman.lug.org.uk [watford-bounces@mailman.lug.org.uk] on behalf of Steve Horsley [steve.horsley@gmail.com]<br>
<b>Sent:</b> 05 December 2012 08:46<br>
<b>To:</b> watford@mailman.lug.org.uk<br>
<b>Subject:</b> Re: [Watford] Bulk Rename Files<br>
</font><br>
</div>
<div></div>
<div>Something like this might work:<br>
find -iname 'out*'  -exec rename -v "s/^OUT???-????????-??????-//g" '{}' \;<br>
<br>
Perehaps a bit slow, but since you've been trying for quite some time, I guess that won't matter too much.<br>
<br>
Steve<br>
<br>
<div class="gmail_quote">On 5 December 2012 08:36, Rob Jefferis <span dir="ltr"><<a href="mailto:rob@letchmore.co.uk" target="_blank">rob@letchmore.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-size:10pt; font-family:Tahoma">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: <a href="mailto:watford-bounces@mailman.lug.org.uk" target="_blank">watford-bounces@mailman.lug.org.uk</a> [<a href="mailto:watford-bounces@mailman.lug.org.uk" target="_blank">watford-bounces@mailman.lug.org.uk</a>] on behalf of Alain Williams [<a href="mailto:addw@phcomp.co.uk" target="_blank">addw@phcomp.co.uk</a>]<br>
Sent: 28 November 2012 00:44<br>
To: <a href="mailto:watford@mailman.lug.org.uk" target="_blank">watford@mailman.lug.org.uk</a><br>
Subject: Re: [Watford] Bulk Rename Files
<div>
<div class="h5"><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>
<a href="tel:%2B44%20%280%29%20787%20668%200256" value="+447876680256" target="_blank">+44 (0) 787 668 0256</a>
<a href="http://www.phcomp.co.uk/" target="_blank">http://www.phcomp.co.uk/</a><br>
Parliament Hill Computers Ltd. Registration Information: <a href="http://www.phcomp.co.uk/contact.php" target="_blank">
http://www.phcomp.co.uk/contact.php</a><br>
#include <std_disclaimer.h><br>
<br>
_______________________________________________<br>
Watford mailing list<br>
<a href="mailto:Watford@mailman.lug.org.uk" target="_blank">Watford@mailman.lug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/watford" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/watford</a><br>
<br>
</div>
</div>
</div>
</div>
</div>
<br>
_______________________________________________<br>
Watford mailing list<br>
<a href="mailto:Watford@mailman.lug.org.uk" target="_blank">Watford@mailman.lug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/watford" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/watford</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>