Re: Need help writing script to find files by date



In article <timmcn-35B3A6.13213501022008@xxxxxxxxxxxxxxxx>, Tim
McNamara <timmcn@xxxxxxxxxxxxx> wrote:

In article <010220081018295433%jimsgibson@xxxxxxxxx>,
Jim Gibson <jimsgibson@xxxxxxxxx> wrote:



No, but the OP asked for a method that would create a file containing
the oldest file names. It is always good to know alternative ways of
doing things.

Right. What I have is a bunch of word processing files in a folder in
the desktop with subfolders nested inside it. These are reports on
services to clients with the client's name and a sequential number for
each individual service to that client (bjones1.doc, bjones2.doc,
bjones3.doc, etc). I want to generate a list that collates the files by
year (2006 and 2007) and then sorts by filename within each year, and
then output that to a text file so I can print it up and provide that to
my employer. (The issue driving this is that up to 30% of my billables
for 2007 have apparently gone missing, so I want to create a list which
the business office can use to track them down and pay me for those
services).

I use Perl for those kind of simple reporting tasks. It really is
useful for that, but then I am a programmer. Perl syntax can be a
little daunting, especially for non-programmers. By installing the
option Perl module Spreadsheet::WriteExcel, I can generate
Excel-readable spreadsheets containing data extracted from text files.

One other problem that can give you "command not found" errors when you
attempt to run a Perl script is line endings: if they are not the
correct type, your script looks like one big line and the shell can't
find the executable for that line. BBEdit and its little cousin
TextWrangler can fix line endings. I don't know if TextEdit can.

--
Jim Gibson

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
.



Relevant Pages

  • Re: Need help writing script to find files by date
    ... Jim Gibson wrote: ... I use Perl for those kind of simple reporting tasks. ... but then I am a programmer. ... TextWrangler can fix line endings. ...
    (comp.sys.mac.system)
  • RE: Segmentation Fault(Core dumped)
    ... But when I started testing my perl script, ... Compilation failed in require at ./test.pl line 13. ... > official business of Sender. ...
    (perl.dbi.users)
  • Re: Help with end of line charaters
    ... the rest have Windoze line endings? ... Note that Perl will make an attempt to "fix" Windoze line ... internals can deal with a constant, rather than have to deal with OS ...
    (comp.lang.perl.misc)
  • Re: sharing variables-data perl-asp
    ... Also how do you invoke a perl script from an active server page? ... ASP in Perl. ... Why do you want to shell out to perl when you're already running perl? ...
    (comp.lang.perl.misc)
  • Re: environment variables in perl scripts
    ... Define a BEGIN block in your perl program. ... > perl script, something like: ... > environment variables are there and diag.txt shows ... > This communication is intended for the use of the ...
    (perl.dbi.users)