develooper Front page | perl.beginners | Postings from January 2011

qmv (renameutils) for cygwin using perl

Thread Next
From:
raphael
Date:
January 22, 2011 01:04
Subject:
qmv (renameutils) for cygwin using perl
Message ID:
AANLkTimps7ddN9MCFtkc7i_0dVUdsquOaC6+EJSVZz4b@mail.gmail.com
Hello,

qmv.exe (from renameutils) lets you edit multiple filenames in a text
editor.
I cannot get it to work in cygwin 1.7x (gives fork + jump error ??). So I
tried to write it in Perl.

qmv's  format is simple

filename-1    <empty space>        filename_1_to_be_edited
filename 2    <empty space>        filename_2_to_be_edited
filename_3    <empty space>        filename_3_to_be_edited

You edit the names and then it renames the files you have changed. Problem I
am having is how can I split the two file names by space
since file name itself might also have spaces in them.

I tried something like this

( $OldFileName, $NewFileName ) = split /\s{5,}/;

It works but not always.
I also thought to use and alternate anchor like pipe or comma but it looks
ugly.
Beside qmv.exe uses space to separate file names Any help would be
appreciated. Thanks.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About