I've managaed to randomly select a line in a .txt file but I'm not sure how I would go about deleting it/removing it.
This is what I'm using to pick a random line, which works fine:
const data = fs2.readFileSync('./randomstuff.txt')
const splitData = data.toString().split("\n");
const randomNumber = Math.floor(Math.random() * splitData.length);
const line = splitData.splice(randomNumber, 1);
How would I then delete "line" from the file? Thanks guys, been struggling with this for a while.