How do you trim the date from a text file. For example, I have multiple files like:
- test_20091011.txt
- try_20091011.txt
- fold_20091011.txt
I would like to change into:
- test.txt
- try.txt
- fold.txt
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This code should work assuming the text file name format doesn’t change, as in, it’s always the last 9 characters you need to remove. This code assumes the txt files are in the folder C:\folder