Arcady Genkin <[EMAIL PROTECTED]> writes:
> What would be the easiest way to rename a bunch of files
>
> foo-[0-9]-bar-[0-9][0-9].txt
>
> into
>
> blah-[0-9]-[0-9][0-9].txt
>
> Note, that all of the files have identical portions `foo-', `-bar-',
> and `.txt' in the filenames. Different are two
Quoting Arcady Genkin ([EMAIL PROTECTED]):
> What would be the easiest way to rename a bunch of files
>
> foo-[0-9]-bar-[0-9][0-9].txt
>
> into
>
> blah-[0-9]-[0-9][0-9].txt
>
> Note, that all of the files have identical portions `foo-', `-bar-',
> and `.txt' in the filenames. Different are two
Arcady Genkin said:
> What would be the easiest way to rename a bunch of files
>
> foo-[0-9]-bar-[0-9][0-9].txt
>
> into
>
> blah-[0-9]-[0-9][0-9].txt
mmv is the way to go. It's in the mmv package (imagine that...); just
install it (if you haven't already done so) and then
mmv "foo-*-bar-*" b
On Sun, 23 Jan 2000, Arcady Genkin wrote:
>
> What would be the easiest way to rename a bunch of files
>
> foo-[0-9]-bar-[0-9][0-9].txt
>
> into
>
> blah-[0-9]-[0-9][0-9].txt
>
> Note, that all of the files have identical portions `foo-', `-bar-',
> and `.txt' in the filenames. Different are
A quick solution that pops out of my head, but it is pretty stupid,
and certainly not the easiest:
ls -1 > rename;
cat rename;
group-1-member-01.txt
group-1-member-02.txt
group-2-member-01.txt
vi rename; then do the following:
:1,$s/\([a-z]*\)\(-[0-9]-\)\([a-z\-]*\)
On Sun, Jan 23, 2000 at 10:54:42PM -0500, Arcady Genkin wrote:
> What would be the easiest way to rename a bunch of files
>
> foo-[0-9]-bar-[0-9][0-9].txt
>
> into
>
> blah-[0-9]-[0-9][0-9].txt
Try the attached Perl script (just put it in a directory that's in your path
and make it executable).
What would be the easiest way to rename a bunch of files
foo-[0-9]-bar-[0-9][0-9].txt
into
blah-[0-9]-[0-9][0-9].txt
Note, that all of the files have identical portions `foo-', `-bar-',
and `.txt' in the filenames. Different are two numerical parts.
For example:
,
| group-1-member-01.txt
|
7 matches
Mail list logo