home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,278 of 68,980   
   Dr J R Stockton to All   
   Add day-of-week to DIR output   
   20 Aug 18 05:57:27   
   
   From: J.R.Stockton@physics.org   
      
   The following adds day-of-week to the default output of DIR in   
   my Windows 7.  Some additional arguments, e.g. /L, can be used.   
   ISO 8601 date/times have been assumed; other formats may work.   
   Adjustments may be needed if the OS is localised foreign.   
      
   // PLUS-DOW.JS Add day-of-week to output of DIR, piped I/O   
   // (c) JRS 2018-08-20+   
   // PLUS-DOW.BAT holds :   
   //  @DIR /o:d %* | CSCRIPT //nologo C:\UTYS\PLUS-DOW.JS   
      
   function AddDoW(match) { return match + " " +   
       new Date(match.replace(/-/g, "/")).toString().substring(0, 3) }   
      
   var stdin = WScript.StdIn   
   var stdout = WScript.StdOut   
   var Str, RE = /(\d\d.+:\d\d )/   
      
   while (!stdin.AtEndOfStream) {   
     Str = stdin.ReadLine()   
     if (RE.test(Str)) {   
       Str = Str.replace(RE, AddDoW)   
       stdout.WriteLine("  " + Str) } }   
      
   // End.  E&OE.   
      
   --   
     (c) John Stockton, near London, UK.  Using Google Groups.           |   
    Mail: J.R.""""""""@physics.org - or as Reply-To, if any.             |   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca