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
"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
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:
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,
-
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
"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 $_'
> >>
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 /
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
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";
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
=?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
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
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:
--
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
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
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
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
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
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
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
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
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
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
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
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{
>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
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
- 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
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'
29 matches
Mail list logo