Here's one way to do it:

#########

if($file =~ /^NQSname.+\.txt$/){
   rename ($file,'NQSname.txt');
}

#########




-----Original Message-----
From: Nishi Bhonsle [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 14, 2006 5:29 PM
To: beginners perl
Subject: strip

Hi:

I have a filenames such as NQSname_l_cs.txt, NQSname_l_da.txt,
NQSname_l_zh-
tw.txt etc.
I would like to modify these filenames such that they are NQSname.txt

What regex i could use to modify these filenames?

Thanks much.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to