How do I use Ruby for  text files creating ?
I have some  utf8 files ex-1.tex, ex-2.tex, ... in a folder.
I would like to use a ruby script to change all these files in this folder 

Example :

ex-1.tex is a text file which contains :     I'm a file test.

After scripting, I would like to get  a file with the same name in a subfolder named "new"
and ex-1.tex now contains :

\input{preamble.ltx}
\begin{document}
I'm a file test.
\end{document}

How to make this?

Thanks and best regards

How do I use Ruby for  text files creating ?
===

I have some  utf8 files ex-1.tex, ex-2.tex, ... in a folder.
I would like to use a ruby script to change all these files in this folder 

Example :

ex-1.tex is a text file which contains :     I'm a file test.

After scripting, I would like to get  a file with the same name in a subfolder named "new"
and ex-1.tex now contains :

\input{preamble.ltx}
\begin{document}
I'm a file test.
\end{document}

How to make this?

Thanks and best regards
