Skip to content

Instantly share code, notes, and snippets.

@Drowze
Created March 28, 2018 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Drowze/22222ea54ecc5c3a7babce631af94b51 to your computer and use it in GitHub Desktop.
Save Drowze/22222ea54ecc5c3a7babce631af94b51 to your computer and use it in GitHub Desktop.
#rename #javascript script to remove CRC code from filenames
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