How to get files based on lastest date

How to write a batch script which is able to grab the files based on the lastest date. In the examples above, I just want to grab the files named AAA_20100910.csv and BBB_20100910.csv, anyone can assist?

yokelai, In this forum, we have quite a bit of generalized knowledge, but you'll likely get more and more knowledgeable responses in the programming forum @:http://www.computing.net/forum/prog...That said, I'd put a variable containing the current date (maybe use an 'if-then' if you need to go back?) to enhance the 'open' statement and narrow down the filename?HTH.Ed in Texas.

The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Compnet Ventures, LLC hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.