# String to File removing quotation marks

If I print a string to a file it also adds quotation marks to the string. Here is an example:

a = "test \t test"
a >> file
FilePrint["file"]


How can I remove those? And is it possible to use \t for a tabulator?

-
see OpenWrite[] and WriteString[] –  george2079 Sep 20 '13 at 17:27
Depending on your problem, Export offers many formatting options that may be useful. –  Yves Klett Sep 21 '13 at 6:51

I think what you may be looking for is the following

a = "test\ntest";
fn = "test";
Put[OutputForm[a], fn];
FilePrint @ fn

test
test


As the documentation for Put states: "Put by default writes expressions in InputForm." So you have to wrap the expression you are writing out with OutputForm.

Note: you could rewrite the above code as

a = "test\ntest";
OutputForm[a] >> "test"
FilePrint @ "test"


but I personally don't use >> -- I have a dislike of it because it uses non-standard evaluation.

Also, I should note that I changed \t to \n only because \n makes for a better demonstration effect.

-