Hi,
I have around 200 txt files in a directory, all files have a "_" and a datestamp in the end of the filename. Is there any single-line command available that i can use to eliminate the "_" + date-part from the file names?
samples:
a1transactions_20140207.txt
b2post_20140207.txt
w32records_20140207.txt
You can see filenames are varying in number of letters in beginning, but the end-part always same which is "_yyyyMMdd". I want to remove this end-part.
After the rename, files should name like:
a1transactions.txt
b2post.txt
w32records.txt
I have around 200 txt files in a directory, all files have a "_" and a datestamp in the end of the filename. Is there any single-line command available that i can use to eliminate the "_" + date-part from the file names?
samples:
a1transactions_20140207.txt
b2post_20140207.txt
w32records_20140207.txt
You can see filenames are varying in number of letters in beginning, but the end-part always same which is "_yyyyMMdd". I want to remove this end-part.
After the rename, files should name like:
a1transactions.txt
b2post.txt
w32records.txt