This file contains hidden or 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 testFolder = './'; // to be run in the directory with all files we are looking to move | |
const fs = require('fs'); | |
fs.readdirSync(testFolder).forEach((file) => { | |
const regex = /SL([0-9]*) Unit([0-9]*) ([0-9\.]*)/; // eg "SL001 Unit403 2005.11.30.pdf" | |
const test = regex.exec(file); | |
if (test) { | |
const sl = test[1]; // First matching group | |
const unit = test[2]; // Second matching group | |
const date = test[3]; |
This file contains hidden or 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 readline = require('readline'); | |
const stdin = process.stdin; | |
readline.emitKeypressEvents(stdin); | |
stdin.setRawMode(true); | |
class Coordinates { | |
constructor(x = 0, y = 0) { | |
this.x = x; |