Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding if a file exists

Status
Not open for further replies.

dvknn

IS-IT--Management
Mar 11, 2003
94
US
Hi,

The format of the file is: fileNameDD-MMM-YYYY.txt.
For example : Sample15-JUN-2004.txt

Thanks
 
OK...Sorry folks..

How can I test if a file in the format fileNameDD-MMM-YYYY.txt exists??

for ex: SampleDD-MMM-YYYY.txt
 
Something like this ?
ls *[0-3][0-9]-[A-Z][A-Z][A-Z]-[12][90][0-9][0-9].txt

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
assuming DD and YYYY are digit, MMM characters

ls|sed -ne '/Sample[0-3][0-9]-[A-z][A-z][A-z]-[0-9][0-9][0-9][0-9]\.txt/p'


:) guggach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top