File manipulation in JS

File manipulation in JS
0

#1

I need help with file manipulation.
I have a file, let’s say one.html with contents

<div>
    one
</div>

I now want to have files from two.html to ten.html with the content inside the div as two for two .html, three for three.html and so on…
Is this even possible in js…???
If yes, how…??? :thinking: :thinking: :thinking: :thinking: :thinking:


#2

It is not possible with JavaScript. Even if there was a way, it would be pretty impractical. You could do it with NodeJs, but then you are just reinventing a portion of what template engine does. Why would you need this behavior?


#3

Why do you want to do this, for what purpose? The are various ways to do similar things, but it’s not very clear what it is you actually want or why you want it done. Just literally moving the contents on your file system? Rendered out on a webpage? Etc.


#4

Thanks @gunhoo93 and @DanCouper for the comments.
I went with using a batch script for the process, it’s done now.