Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] remove last 3 characters

Expand Messages
  • Jeff Eggen
    ... I like File::Basename, myself. ======= use File::Basename; ($file, $path, $suffix) = fileparse( /path/to/01Jan2002-23:00:02.log.gz01Jan2002-12:00:02.log
    Message 1 of 2 , Jun 28, 2002
      >I have the following file: 01Jan2002.log.gz

      >and I would like to remove the last 3 characters ( .gz ) so that it
      >looks like this: 01Jan2002-12:00:02.log

      I like File::Basename, myself.


      use File::Basename;

      ($file, $path, $suffix) = fileparse("/path/to/01Jan2002-23:00:02.log.gz01Jan2002-12:00:02.log

      print $file . "\n" . $path . "\n" . "$suffix" . "\n";


      This should yield the following output:


      Hope this helps,

      Jeff Eggen
      IT Programmer Analyst
      Saskatchewan Government Insurance
      Ph (306) 751-1795
      email jeggen@...
      "The best way to accelerate a Win9x machine is at 9.81m/s2."
    Your message has been successfully submitted and would be delivered to recipients shortly.