Re: renaming files

2006-06-30 Thread Rob Dixon
Adriano Allora wrote: hi to all, does exists a way to rename automatically files? I mean: I've got directories with this content: EN0.tmp EN1.tmp EN2.tmp EN3.tmp EN4.tmp ... IT0.tmp IT1.tmp IT2.tmp IT3.tmp IT4.tmp ... Now, some couples of files were deleted (you can imagine the EN1.tmp/IT1.t

Re: renaming files

2006-06-30 Thread Dr.Ruud
"Mr. Shawn H. Corey" schreef: > Adriano Allora: >> does exists a way to rename automatically files? > > No. > > See: > perldoc -f rename > perldoc -f glob > perldoc File::Find > perldoc File::Copy (and search for "move") And of course: IO::All. http://search.cpan.org/search?module=IO::All

RE: renaming files

2006-06-30 Thread Jeff Peng
Hello. Instead of `mv..` system call,you could use perl's inner function 'rename()' to do the things you wanted. Also use 'File::Find' to do the searching for files. From: Adriano Allora <[EMAIL PROTECTED]> To: beginners@perl.org Subject: renaming files Date:

Re: renaming files

2006-06-30 Thread Mr. Shawn H. Corey
On Fri, 2006-30-06 at 16:48 +0200, Adriano Allora wrote: > hi to all, > > does exists a way to rename automatically files? No. See: perldoc -f rename perldoc -f glob perldoc File::Find perldoc File::Copy (and search for "move") -- __END__ Just my 0.0002 million dollars worth, -

renaming files

2006-06-30 Thread Adriano Allora
hi to all, does exists a way to rename automatically files? I mean: I've got directories with this content: EN0.tmp EN1.tmp EN2.tmp EN3.tmp EN4.tmp ... IT0.tmp IT1.tmp IT2.tmp IT3.tmp IT4.tmp ... Now, some couples of files were deleted (you can imagine the EN1.tmp/IT1.tmp) but I need no holes

Re: pb of listing and renaming files

2003-03-19 Thread John W. Krahn
"Scott R. Godin" wrote: > > Rob Dixon wrote: > > > Hi Scott. > > > > Scott R. Godin wrote: > >> John W. Krahn wrote: > >> > >> > chomp; > >> > if ( /(.*)\.BMP/ ) { > >> > print "processing image $_ ..\n"; > >> > system( 'mv', $_, "$1.bmp" ) == 0 or die "system 'mv $_' > >>

Re: pb of listing and renaming files

2003-03-19 Thread Scott R. Godin
Rob Dixon wrote: > Hi Scott. > > Scott R. Godin wrote: >> John W. Krahn wrote: >> >> > chomp; >> > if ( /(.*)\.BMP/ ) { >> > print "processing image $_ ..\n"; >> > system( 'mv', $_, "$1.bmp" ) == 0 or die "system 'mv $_' >> > failed: $?"; >> > } >> >> next unless /

Re: pb of listing and renaming files

2003-03-18 Thread Rob Dixon
Hi Scott. Scott R. Godin wrote: > John W. Krahn wrote: > > > chomp; > > if ( /(.*)\.BMP/ ) { > > print "processing image $_ ..\n"; > > system( 'mv', $_, "$1.bmp" ) == 0 or die "system 'mv $_' > > failed: $?"; > > } > > next unless /(.*)\.BMP$/;#anchor it to the end

Re: pb of listing and renaming files

2003-03-18 Thread Scott R. Godin
John W. Krahn wrote: > chomp; > if ( /(.*)\.BMP/ ) { > print "processing image $_ ..\n"; > system( 'mv', $_, "$1.bmp" ) == 0 or die "system 'mv $_' failed: > $?"; > } next unless /(.*)\.BMP$/;#anchor it to the end of the string! print "processing image file: $_\n";

Re: pb of listing and renaming files

2003-03-17 Thread John W. Krahn
R p wrote: > > hi all Hello, > i am a beginner and i need some help from you: > here is my problem: > -- > i have to filter all files *.BMP and to rename all by > *.bmp > -- > here is my scrip

Re: pb of listing and renaming files

2003-03-17 Thread Paul Johnson
=?iso-8859-1?q?r=20p?= said: > hi all > > i am a beginner and i need some help from you: > here is my problem: > -- > i have to filter all files *.BMP and to rename all by > *.bmp > -- > here i

RE: pb of listing and renaming files

2003-03-17 Thread David Olbersen
Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: r p [mailto:[EMAIL PROTECTED] > Sent: Monday, March 17, 2003 8:52 AM > To: [EMAIL PROTECTED] > Subject: pb of listing and renaming files > > > hi all > > i am a beginner and i need

pb of listing and renaming files

2003-03-17 Thread r p
hi all i am a beginner and i need some help from you: here is my problem: -- i have to filter all files *.BMP and to rename all by *.bmp -- here is my script: --

Re: renaming files (versioning)

2002-02-22 Thread Johannes Franken
On Tue, Feb 19, 2002 at 11:52:24PM -0500, Bill Akins wrote: > I have to keep all versions of the existing files and oldest must > have the highest -v## (version number) and newest is just data.txt. > Is this a job better done in bash or perl? what about rcs? (that's "revision control system" an

Re: renaming files (versioning)

2002-02-20 Thread Sudarsan Raghavan
Bill Akins wrote: > Hi all, > > After processing files in my perl script, I need to move them to the final > destination. My problem is if the file already exists (lets call it > data.txt), I need to rename it to data-v01.txt (where -v01 is version 01). > > So... if there are four other esisting

renaming files (versioning)

2002-02-19 Thread Bill Akins
Hi all, After processing files in my perl script, I need to move them to the final destination. My problem is if the file already exists (lets call it data.txt), I need to rename it to data-v01.txt (where -v01 is version 01). So... if there are four other esisting versions, data-v03.txt should

Re: Renaming files with Perl

2002-02-08 Thread Jeff 'japhy' Pinyan
On Feb 8, Troy May said: >I posted a question about this a couple days ago and only got 2 responses, >but neither of them worked for him. So I figured I'd start new since he >told me the EXACT format he would like the files to be in. My friend wants >to rename a dat file as he calls it. (messa

RE: Renaming files with Perl

2002-02-08 Thread John Edwards
http://www.google.com/search?sourceid=navclient&q=perl+rename+file HTH John -Original Message- From: Troy May [mailto:[EMAIL PROTECTED]] Sent: 08 February 2002 14:50 To: Perl Beginners Subject: Renaming files with Perl Hello, I posted a question about this a couple days ago and

Renaming files with Perl

2002-02-08 Thread Troy May
Hello, I posted a question about this a couple days ago and only got 2 responses, but neither of them worked for him. So I figured I'd start new since he told me the EXACT format he would like the files to be in. My friend wants to rename a dat file as he calls it. (message.dat?) He would lik

Renaming files on the server

2002-02-07 Thread Troy May
Hello all, My friend (who doesn't English too well yet) has been emailing me asking about a guestbook he made. It sounds like he wants to archive his message files with a certain format and back them up automatically everyday. Here's his last email to me: "i want to store all those message eve

Re: renaming files - fatuous newbie query

2001-12-07 Thread Frank
On Fri, Dec 07, 2001 at 11:41:05AM -0500, McCarney, wrote: > Ok team, here's the deal. > I am *not* a programmer or a sysadmin, so be gentle. ;) > > Here is the code--checked it out in perldoc -q. Wow, it works... > My platform: Windows 2000 > > #! perl -w > use strict; > use File::Copy; opendi

renaming files - fatuous newbie query

2001-12-07 Thread McCarney, James Alexander
Ok team, here's the deal. I am *not* a programmer or a sysadmin, so be gentle. ;) Here is the code--checked it out in perldoc -q. Wow, it works... My platform: Windows 2000 #! perl -w use strict; use File::Copy; move("file1.txt", "file3.txt"); That's great, but I have umpteen scores of files

RE: Renaming Files Help

2001-07-26 Thread jbarry
Nevermind, I figured it out. I'm only passing the file name in the rename script, I had to add the whole path to it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 26, 2001 1:42 PM To: [EMAIL PROTECTED] Subject: Renaming Files Help I

Re: Renaming Files Help

2001-07-26 Thread Michael Fowler
On Thu, Jul 26, 2001 at 01:42:11PM -0500, [EMAIL PROTECTED] wrote: > #!/usr/bin/perl -w You forgot use strict. Always use strict when debugging code. > #rename > use File::Find; > $DIRLIST = ('D:\PATH\To-Be Model\Data'); > find(\&process_file, $DIRLIST); > rename_files(); > > sub process_file

Renaming Files Help

2001-07-26 Thread jbarry
I keep getting an error when I run this script - No such file or directory. What am I missing? #!/usr/bin/perl -w #rename use File::Find; $DIRLIST = ('D:\PATH\To-Be Model\Data'); find(\&process_file, $DIRLIST); rename_files(); sub process_file{ push (@files, $_); }; sub rename_files{

Re: renaming files in a directory....

2001-04-21 Thread Syarzhuk Kazachenka
>I'd like to rename the existing files in a directory to "filename.txt" The >files have no extensions, and have names like: >B0724 B0834 B1236 B1356 B1370 >A0012 A0036 A0050 A0120 A0302 A0310 rename1.pl Why do you need Perl here? If you want to change extensions of all files to .txt, use this c

Re: renaming files in a directory....

2001-04-20 Thread John Joseph Trammell
On Fri, Apr 20, 2001 at 06:08:47PM -0400, McCormick, Rob E wrote: [snip] One thing I find confusing about your example is that you're using the same variable ($msds_files) twice, for different things. How about something like: #!c:/perl/bin/perl -w use strict; my $dir = "c:/winnt/profiles/mypro

Re: renaming files in a directory....

2001-04-20 Thread M.W. Koskamp
- Original Message - From: McCormick, Rob E <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, April 21, 2001 12:08 AM Subject: renaming files in a directory > I can print a file listing with this: > Try to do the rename in the while loopm cuz it loops

renaming files in a directory....

2001-04-20 Thread McCormick, Rob E
Gang, I'd like to rename the existing files in a directory to "filename.txt" The files have no extensions, and have names like: B0724 B0834 B1236 B1356 B1370 A0012 A0036 A0050 A0120 A0302 A0310 rename1.pl Y Z I pulled a sample of files over to a test directory on my desktop and I'