var rf = require('fs');
var arm = process.argv[2];
rf.readFile(arm, 'utf-8', function (err, data) {
    if (err) {
        console.log('error');
    } else {
        console.log('finish');
        arm = arm.split('.');
        arm.pop();
        arm = arm.join('.') + '.txt';
        rf.writeFile(arm, JSON.stringify(data), function (err) {
        });
    }
}); 