Skip to content

Instantly share code, notes, and snippets.

@tyage
Created December 19, 2010 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyage/747027 to your computer and use it in GitHub Desktop.
Save tyage/747027 to your computer and use it in GitHub Desktop.
var fs = require('fs'),
sys = require('sys');
fs.readFile('1.txt', "utf-8", function (err, data) {
data.split('\n').forEach(function (val, i) {
if (i == 0) {
all = val;
} else {
all -= val;
}
})
fs.writeFile('1.txt', all+'')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment