1.

Solve : Listing log file in dd_mm_yy.txt format?

Answer» HI everyone,

I want to list log files whose names are changing daily. Like that;

C:\log\dd_mm_yy.txt

"dd_mm_yy.txt" is changing daily. What kind of a definition I must use in Windows command prompt to list the log file ? Could you PLEASE help me about how can I solve that problem?

Best Regards
Murat Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

Quote
C:\Users\Dave>dir/?
Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
  [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

  [drive:][path][filename]
              Specifies drive, directory, and/or files to list.

  /A          Displays files with specified attributes.
  attributes   D  Directories                R  Read-only files
               H  HIDDEN files               A  Files ready for archiving
               S  System files               I  Not content indexed files
               L  Reparse Points             -  Prefix MEANING not
  /B          Uses bare format (no heading information or summary).
  /C          Display the thousand separator in file sizes.  This is the
              default.  Use /-C to disable display of separator.
  /D          Same as wide but files are list sorted by column.
  /L          Uses lowercase.
  /N          New long list format where filenames are on the far right.
  /O          List by files in sorted order.
  sortorder    N  By name (alphabetic)       S  By size (smallest first)
               E  By extension (alphabetic)  D  By date/time (oldest first)
               G  Group directories first    -  Prefix to reverse order
Press any key to continue . . .

Dir /o *.txt

Will list the log files that are saved as text files in numeric/alpha order. You can use sort order to list differently. Code: [Select]C:\log>dir /a-d /b | findstr /R /C:"[0-9][0-9]_[0-9][0-9]_[0-9][0-9].txt"
07_05_14.txt
08_05_14.txt
09_05_14.txt


Discussion

No Comment Found