Skip to content

Instantly share code, notes, and snippets.

@Dianliang233
Last active July 4, 2021 10:53
Show Gist options
  • Save Dianliang233/18202d01bd499e48a97229d34cf674a7 to your computer and use it in GitHub Desktop.
Save Dianliang233/18202d01bd499e48a97229d34cf674a7 to your computer and use it in GitHub Desktop.
Minecraft bug sorter by @ _LittleC_
# by _LittleC_
const fs = require('fs')
const _ = require('lodash')
let list = _.chunk(fs.readFileSync("1.txt").toString().split("\r\n"), 2)
let result = list.map(v => {
return {
id: ~~(v[0].match(/MC-(\d*)/)[1]),
data: v
}
})
result = _.sortBy(result, 'id')
fs.writeFileSync("result.txt", _.flattenDeep(result.map(v => v.data)).join("\n"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment