Created
March 28, 2018 01:52
-
-
Save Drowze/22222ea54ecc5c3a7babce631af94b51 to your computer and use it in GitHub Desktop.
#rename #javascript script to remove CRC code from filenames
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs') | |
path = '../Cardcaptor Sakura TV series A-S/' | |
fs.readdir(path, function(err,files) { | |
if(err) throw err; | |
files.forEach(function(file, index) { | |
replaced_file = file.replace(/\[........\]/, ''); | |
fs.rename(path + file, path + replaced_file, function(err) { | |
if(err) throw err; | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment