Created
July 24, 2020 08:50
-
-
Save lipengzhou/71dda349faca45c84c4ec71514591664 to your computer and use it in GitHub Desktop.
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
const fs = require('fs') | |
const files = fs.readdirSync('./') | |
const trecFiles = files.filter(file => file.endsWith('.mp4')) | |
const start = 1 | |
trecFiles.forEach((item, index) => { | |
let seq = start + index | |
if (seq < 10) { | |
seq = `0${seq}` | |
} | |
fs.renameSync(item, `${seq} ${item.split(' ')[1]}`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment