# How to export a List with the values separated by a simple empty space?

I have this: list=Range[1,4] and I want to Export the values in a text-file. But the values should be separated by a single empty space, like this:

in MMA[ {1,2,3,4} ] -> in txt-file[ 1 2 3 4 ]

How do I get extended control over the export options? Thanks for any hints!

Consult the ref/format/Table section of the documentation.

Using "Table" as the export format and specifying the option "FieldSeparators" -> " " you can get what you want:

ExportString[{Range[4]}, "Table", "FieldSeparators" -> " "]
(* 1 2 3 4 *)


Note that I've wrapped Range[] in a list like {Range[4]}, since each element at the top level is expected to be a row.

To have a more general control over the import and export options you can also try spelunking:

<<GeneralUtilities
PrintDefinitions[Export]


After some searching there I found a function called SystemConvertTableDumpExportTable which admits the options

"LineSeparators"
"FieldSeparators"
"TextDelimiters"

You can either search around in this way if the documentation doesn't provide enough information or just roll your own export routine with the help of functions such as OpenWrite and others, when the built-in functionality isn't enough.