Hi eventual,
On Monday 25 Apr 2011 06:22:54 eventual wrote:
> Hi,
> I am using windows operating system.
> I wanted to rename some files within certain directories and my files
> contain chinese characters. After renaming, I could not see those chinese
> characters, what must I do to retain those
: eventual
Sent: Mon, April 25, 2011 11:38:17 AM
Subject: Re: how to rename files that contain chinese characters
On Mon, Apr 25, 2011 at 12:22 AM, eventual wrote:
Hi,
>I am using windows operating system.
>I wanted to rename some files within certain directories and my files contain
>
Hi,
I am using windows operating system.
I wanted to rename some files within certain directories and my files contain
chinese characters. After renaming, I could not see those chinese characters,
what must I do to retain those chinese characters. Below is the file name and
the script. Thanks
fi
On 7/14/08, Rob Dixon <[EMAIL PROTECTED]> wrote:
>
>
> jet speed wrote:
> >
> > I put togather few lines of code, I am looking to achieve the below
> >
> > dir1 with file1, file2
> > dir2 with file1, file2
> >
> > i want to copy the files from each of the directory to a third directory
> > dir3 a
jet speed wrote:
>
> I put togather few lines of code, I am looking to achieve the below
>
> dir1 with file1, file2
> dir2 with file1, file2
>
> i want to copy the files from each of the directory to a third directory
> dir3 as file1, file2 from dir1 and rename the file1 as file3 and file2 as
Hi All,
I put togather few lines of code, I am looking to achieve the below
dir1 with file1, file2
dir2 with file1, file2
i want to copy the files from each of the directory to a third directory
dir3 as file1, file2 from dir1 and rename the file1 as file3 and file2 as
file4 from the dir2.
dir
ure of the best way to do this. I have been trying to use
> globbing and substitution (to substitute TEST with nothing). I am
> unsure how to rename files in multiple directories.
A perfect job for IO::All.
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EM
.doc. all files have TEST in the name.
> I am unsure of the best way to do this. I have been trying to use globbing
> and substitution (to substitute TEST with nothing). I am unsure how to
> rename files in multiple directories.
>
> Thanks
>
You want the File::Find* module, th
.
You can tell Perl to open all the contents of a folder and check if it
is a directory or a file (-d or -f). If it is a directory, you
recurse. If it is a file, you can use a RegEx to check if it has
"TEST" and to remove it.
The rename function will rename files for you.
--
To unsu
o use globbing
and substitution (to substitute TEST with nothing). I am unsure how to
rename files in multiple directories.
Thanks
Wijaya Edward wrote:
Hi all,
I have a snippet that rename files from:
"sth.txt.out" into
"sth.out"
Now I am really curious how can I make this
oneliner "even shorter":
$ perl -e '
for(glob ("*.txt.out")){
$out = $_;
$out =~ s/\.txt(\.o
>>>>> "Wijaya" == Wijaya Edward <[EMAIL PROTECTED]> writes:
Wijaya> Hi all,
Wijaya> I have a snippet that rename files from:
Wijaya> "sth.txt.out" into
Wijaya> "sth.out"
Wijaya> Now I am really curious how can I make this
Wijay
Wijaya Edward wrote:
> Hi John,
>
> From: "John W. Krahn" <[EMAIL PROTECTED]>
>
>>mmv '*.txt.out' '#1.out'
>
> you mean just:
>
> mv '*.txt.out' '#1.out'
>
> right ? and not "mmv"
No, I meant mmv.
$ man mmv
MMV(1)
NAME
mmv - move/copy/append/link multiple files by wildcard pattern
Wijaya Edward wrote:
> Hi all,
Hello,
> I have a snippet that rename files from:
> "sth.txt.out" into
> "sth.out"
>
> Now I am really curious how can I make this
> oneliner "even shorter":
mmv '*.txt.out' '#1.out'
&
Hi all,
I have a snippet that rename files from:
"sth.txt.out" into
"sth.out"
Now I am really curious how can I make this
oneliner "even shorter":
$ perl -e '
for(glob ("*.txt.out")){
$out = $_;
$out =~ s/\.txt(\.out)/\.out/;
rename ($_,$out);
- Original Message -
From: "John W. Krahn" <[EMAIL PROTECTED]>
To: "Perl Beginners"
Sent: Wednesday, May 11, 2005 5:02 PM
Subject: Re: rename files
[EMAIL PROTECTED] wrote:
Hi,
Hello,
I want to rename all the files in a directory with filenames starting
1.j
On 5/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> - Original Message -
> From: "bright true" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Cc:
> Sent: Wednesday, May 11, 2005 2:55 PM
> Subject: Re: rename files
>
&
[EMAIL PROTECTED] wrote:
Hi,
Hello,
I want to rename all the files in a directory with filenames starting
1.jpg to n.jpg.
Why this code does not rename the files?
opendir(DIR, "/tmp") or die "can not open dir: $!\n";
my @files = grep {/.jpg/ } readdir(DIR);
closedir(DIR);
my $count = 1;
foreach (
- Original Message -
From: "bright true" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc:
Sent: Wednesday, May 11, 2005 2:55 PM
Subject: Re: rename files
The following would rename any file in a directory (.anything) into numbers
in the same extention i hope it
The following would rename any file in a directory (.anything) into numbers
in the same extention i hope it will be usfull
opendir(DIR,"$dir") or print "$!";
my @content = sort(readdir(DIR));
closedir(DIR);
my $no=0;
*foreach my* $number (@content){
$no++;
$number =~m/\S+\.(\S+)/;
rename("$dir/
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Wednesday, May 11, 2005 2:23 PM
Subject: Re: rename files
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Wednesday, May 11, 2005 2:08 PM
Subject: rename files
Hi,
I want to rename all th
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Wednesday, May 11, 2005 2:23 PM
Subject: Re: rename files
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Wednesday, May 11, 2005 2:08 PM
Subject: rename files
Hi,
I want to rename all th
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Wednesday, May 11, 2005 2:08 PM
Subject: rename files
Hi,
I want to rename all the files in a directory with filenames starting
1.jpg to n.jpg.
Why this code does not rename the files?
More on above,
All the files are a
1, 2005 10:08 PM
Subject: rename files
> Hi,
>
> I want to rename all the files in a directory with filenames starting
1.jpg
> to n.jpg.
> Why this code does not rename the files?
>
> opendir(DIR, "/tmp") or die "can not open dir: $!\n";
> my @files = gre
Hi,
I want to rename all the files in a directory with filenames starting 1.jpg
to n.jpg.
Why this code does not rename the files?
opendir(DIR, "/tmp") or die "can not open dir: $!\n";
my @files = grep {/.jpg/ } readdir(DIR);
closedir(DIR);
my $count = 1;
foreach (@files){
print "@files\n"; # wo
Brian Milbrandt wrote:
Please dont' top post :)
I appreciate the help, is there a way to do it by taking the source and
target directory's as command line arguments? that is how the unix script
is written that I am trying to convert.
my $source = $ARGV[0];
my $target = $ARGV[1];
may want to add
: Wednesday, April 20, 2005 3:14 PM
Subject: Re: Copy and rename files
A correction to the code for 1 line below :-(
Chris
Hello Brian,
I did what you wanted to do on my computer, (Windows XP). The code is
pasted below, followed by some explanations. You should be able to get
the same results b
A correction to the code for 1 line below :-(
Chris
Hello Brian,
I did what you wanted to do on my computer, (Windows XP). The code is
pasted below, followed by some explanations. You should be able to get the
same results by plugging in abc and xyz where I had html and txt. Also,
with source a
- Original Message -
From: "Brian Milbrandt" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
To:
Sent: Tuesday, April 19, 2005 6:22 PM
Subject: Copy and rename files
I am trying to convert a unix script to perl. The script takes 2 command
line arguments, source and targ
ot;Brian Milbrandt" <[EMAIL PROTECTED]>;
Sent: Tuesday, April 19, 2005 5:31 PM
Subject: RE: Copy and rename files
Wagner, David --- Senior Programmer Analyst --- WGO wrote:
Brian Milbrandt wrote:
I am trying to convert a unix script to perl. The script takes 2
command line arguments, sour
Wagner, David --- Senior Programmer Analyst --- WGO wrote:
> Brian Milbrandt wrote:
>> I am trying to convert a unix script to perl. The script takes 2
>> command line arguments, source and target. I am unable to get the
>> file copy and rename function working properly. Here is what I have
>> t
Brian Milbrandt wrote:
> I am trying to convert a unix script to perl. The script takes 2
> command line arguments, source and target. I am unable to get the
> file copy and rename function working properly. Here is what I have
> that is not working properly.
>
> $target is the target direct
I am trying to convert a unix script to perl. The script takes 2 command line
arguments, source and target. I am unable to get the file copy and rename
function working properly. Here is what I have that is not working properly.
$target is the target directory variable
$source is the source d
Pete Emerson wrote:
>
> John W. Krahn wrote:
> >
> >Due to way some file systems work I would store the file names in an
> >array and use the array to rename the files instead of renaming them in
> >the File::Find::find() sub.
> >
> Can you expand on this a little? Is this a performance issue or a
John W. Krahn wrote:
Just a couple of comments if you don't mind. (I knew you wouldn't :-)
Of course not, that's how I keep on learning! :)
Due to way some file systems work I would store the file names in an
array and use the array to rename the files instead of renaming them in
the File::Fi
Barry C.Hawkins said:
> On Thursday, Jul 10, 2003, at 13:07 US/Eastern, Pete Emerson wrote:
>
>> Barry,
>>
>> I just wrote my own version of your script. Not that it's better than
>> yours, just different. I've learned a lot from this list by seeing how
>> people do things differently than me! I
Pete Emerson wrote:
>
> I just wrote my own version of your script. Not that it's better than
> yours, just different. I've learned a lot from this list by seeing how
> people do things differently than me! I hope you find my version helpful.
>
> A couple of notes about mine:
>
> 1) The director
On Thursday, Jul 10, 2003, at 13:07 US/Eastern, Pete Emerson wrote:
Barry,
I just wrote my own version of your script. Not that it's better than
yours, just different. I've learned a lot from this list by seeing how
people do things differently than me! I hope you find my version
helpful.
A c
Barry,
I just wrote my own version of your script. Not that it's better than
yours, just different. I've learned a lot from this list by seeing how
people do things differently than me! I hope you find my version helpful.
A couple of notes about mine:
1) The directory is taken from the command
Hail to the list!
I have just started to learn Perl, but I had a task come up that
couldn't wait for my slow progress through Programming Perl, 3rd ed.
This script renames files in a specified directory. It seems to work
OK, but I am wondering if it could be better. By better, I mean more
r
40 matches
Mail list logo