Created
August 9, 2017 20:41
-
-
Save ChrisCinelli/682bcecd8cdae3cc61002c0fab8cbd75 to your computer and use it in GitHub Desktop.
Convert text in one line of text for each line for faster comparison
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
// Usage: node fromTextToOneWordForLine.js < infile >outfile | |
// You can then use opendiff to find the real differences | |
var fs = require('fs'); | |
var stdinBuffer = fs.readFileSync(0); // STDIN_FILENO = 0 | |
var text = stdinBuffer.toString(); | |
console.log(text.replace(/(\s|[^a-z])+/gi, '\n')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment