Re: perl one liner to remove all but the base file name
- From: "Oxnard" <oxnard@xxxxxxxxxxxxxxx>
- Date: Sat, 3 Feb 2007 07:34:52 -0500
"Abigail" <abigail@xxxxxxxxxx> wrote in message
news:slrnes536r.ekq.abigail@xxxxxxxxxxxxxxxxxxxxxxx
Oxnard (oxnard@xxxxxxxxxxxxxxx) wrote on MMMMCMIII September MCMXCIII in
<URL:news:45c28416$0$16668$4c368faf@xxxxxxxxxxxxxx>:
&& If I have a file name like:
&&
&& /dkdk888/jdty/file.txt
&&
&& how can I get to just 'file' using a regex. I have come up with
&& or
&& /dkdk/dkdue/dfdf.txt.1234
&&
&& and ending up with 'dfdf'
&&
&& I have come up with 's/^.*\/\([^/]*\)$/\1/' but cannot get rid of the
&& extension. Also I have thought about using basename with the suffix
but the
&& suffix can be different.
s !.*/!!; s !\.[^.]+$!!;
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
What does the !! do ... I cannot find a reference to it.
.
- Follow-Ups:
- Re: perl one liner to remove all but the base file name
- From: Tad McClellan
- Re: perl one liner to remove all but the base file name
- From: kens
- Re: perl one liner to remove all but the base file name
- References:
- perl one liner to remove all but the base file name
- From: Oxnard
- Re: perl one liner to remove all but the base file name
- From: Abigail
- perl one liner to remove all but the base file name
- Prev by Date: Re: Problems dealing with dates in Windows
- Next by Date: Re: perl one liner to remove all but the base file name
- Previous by thread: Re: perl one liner to remove all but the base file name
- Next by thread: Re: perl one liner to remove all but the base file name
- Index(es):
Relevant Pages
|
|