Skip to main content
2 of 5
added 64 characters in body
Alex
  • 351
  • 1
  • 9

Using Mathematica to batch-produce text files

I need to make a bunch of plaintext files, all of which differ only in a single parameter. I was thinking in doing something like this:

For[i,1,10,a="Hello World"<>ToString[i];Export["directory"<>ToString[i]<>".txt",a,"Plaintext"]]

However, the real text I want to export presents two difficulties, namely that it contains quotes (") that I would also want to export, and greek letters that I would want changed for their code version (i.e, when I write \[Alpha] in Mathematica it just represents it as α, but I want in the exported file \[Alpha] to appear).

Is there any way I can do what I want to do? If so, how?

Thank you so much for your help

Alex
  • 351
  • 1
  • 9