Unix questions - rename files

This is Interesting: Free IT Magazines  
Home > Archive > Unix questions > October 2004 > rename files





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author rename files
Gabriella

2004-10-02, 9:13 pm

I would like to shorten file name from search?q=opq to opq. For one
file, I did mv command and it works. The question now: how to shorten
the name of many files at the same time.
list of files:
search?q=opq
search?q=odf
search?q=kjl
etc

output
opq
odf
kjl

Thanks
parv

2004-10-02, 9:13 pm

in message <17c19ad9.0410021253.1e520d6a@posting.google.com>,
wrote Gabriella ...

> I would like to shorten file name from search?q=opq to opq. For
> one file, I did mv command and it works. The question now: how to
> shorten the name of many files at the same time.
> list of files:
> search?q=opq
> search?q=odf
> search?q=kjl
>
> opq
> odf
> kjl


One of these should be able to help you...

Interesting threads/posts related to moving
--------------------------------------------
http://groups.google.com/groups?th=b45310c8ba0519a
http://groups.google.com/groups?sel...9%40adm.brl.mil

Search, in comp.unix.* groups, related to file renaming
-------------------------------------------------------
http://groups.google.com/groups?q=r...p%3Acomp.unix.*
http://groups.google.com/groups? q=...p%3Acomp.unix.*
http://groups.google.com/groups? q=...p%3Acomp.unix.*

rename (in Perl)
----------------
http://www.oclug.on.ca/pipermail/oc...rch/018696.html
http://perlmonks.org/index.pl?node_id=303814
http://perlmonks.org/index.pl?node_id=277174


My own PERL module (does not actually moves files, give new names
to /you/ to take care of moving)
--------------------------------------------------------------------
http://www103.pair.com/parv/comp/sr...ize-1.01.tar.gz

Documentation:
http://www103.pair.com/parv/comp/sr...me-Sanitize.pod

An example usage of above module:
http://www103.pair.com/parv/comp/src/perl/sanename
http://www103.pair.com/parv/comp/sr...til-1.10.tar.gz


- parv

--
As nice it is to receive personal mail, too much sweetness causes
tooth decay. Unless you have burning desire to contact me, do not do
away w/ WhereElse in the address for private communication.

Stephane CHAZELAS

2004-10-04, 6:01 pm

2004-10-2, 13:53(-07), Gabriella:
> I would like to shorten file name from search?q=opq to opq. For one
> file, I did mv command and it works. The question now: how to shorten
> the name of many files at the same time.
> list of files:
> search?q=opq
> search?q=odf
> search?q=kjl
> etc
>
> output
> opq
> odf
> kjl


If your shell is zsh (4.0 or above):

autoload -U zmv

zmv 'search\?q=(*)' '$1'

--
Stephane
parv

2004-10-05, 8:47 pm

in message <slrnclue53.18d.parv_@localhost.holy.cow>,
wrote parv ...

> in message <17c19ad9.0410021253.1e520d6a@posting.google.com>,
> wrote Gabriella ...
>
>
> One of these should be able to help you...


Another one, untested but interesting, i found about on Unix Review
site ...

http://www.student.lu.se/~nbi98oli/renameutils.html


- parv

--
As nice it is to receive personal mail, too much sweetness causes
tooth decay. Unless you have burning desire to contact me, do not do
away w/ WhereElse in the address for private communication.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com