i wants to save the fiilename in samefile and the format is like that

Filename:[email protected]_9_45_45_PM.wav

want the above filename in same file as

02_27_2017

[email protected]

9_45_45

like this


Please i want to write the filename in samefile i did that one like below 
but its actually removing the already existed data in the same file and 
writing the same file name itself.

const testFolder = './tests/';
const fs = require('fs');
fs.readdir(testFolder, (err, files) => {

files.forEach(file => {

console.log(file.substring(0,file.length-4));

fs.writeFile('./tests/'+file, file.substring(-4), function(err) {

if(err) 
{
return console.log(err);
}

}); 
})
})

so i want to keep the alrady existed data how i can please let me 
know...thanks

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/1291e75d-e9a9-4df8-b1de-b8d32b2849d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to