perl one liner to remove all but the base file name
- From: "Oxnard" <oxnard@xxxxxxxxxxxxxxx>
- Date: Thu, 1 Feb 2007 19:21:40 -0500
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.
Thanks
.
- Follow-Ups:
- Re: perl one liner to remove all but the base file name
- From: Ayaz Ahmed Khan
- Re: perl one liner to remove all but the base file name
- From: Abigail
- Re: perl one liner to remove all but the base file name
- From: Paul Lalli
- Re: perl one liner to remove all but the base file name
- Prev by Date: Re: Upload file fails
- Next by Date: Re: Read on closed filehandle
- Previous by thread: Read on closed filehandle
- Next by thread: Re: perl one liner to remove all but the base file name
- Index(es):
Relevant Pages
|