troubleshooting Question

How to delete particular files in a directory?

Avatar of ipjyo
ipjyoFlag for United States of America asked on
C#.NET Programming
3 Comments2 Solutions308 ViewsLast Modified:

I have two types of files in a directory as below. Both of them are text files but distinguished by the name prefix "PST" or "SEQ".

PST-051311, PST-051211 etc
SEQ-051311, SEQ-051211, SEQ-051011 etc

I need to look at the directory and for each of those files that start with SEQ, get the date part after the hyphen and if there is no PST file with the same date after the hyphen then delete the SEQ file. In the above example, the file SEQ-051011 should be deleted.

I am looking for some ideas how to do this? Thanks for any ideas.

Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros