--- myst: substitutions: bloc: python: 3-10 cpp: 3,6-12 --- # Export to an ASCII file In the same way as the data are imported from an ASCII file, we can also save the data of a {{tds}} in an ASCII file. Currently, four methods of export are available in {{uranie}}: - using the same format as that observed during import ("Salome Table"); - using a **C** file containing the data vectors that can be inserted in a **C** program. - using the **NeMo** format: the generated file is useful for the **NeMo** tool for constructing neural response surface developed at STMF. - using the **JSON** format: the generated file is easily transferable to any other program that include the JSON protocol. This file can also be read through the `fileDataReadJSon` method of a {{tds}} object. {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/dataserver/data/" + language + "/export_ascii_file." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc[language] + "\n" + "```" }} **Data export from a {{tds}} in an ASCII file** 1. Export the data of the {{tds}} *tdsGeyser* in an ASCII file `"newfile.dat"`: {{ "```{literalinclude} " + parent_dir + "/usermanual/dataserver/files/geysernewfile.dat\n" + ":language: none\n" + "```" }} 2. Exports the data of attributes *x1, x2 and y* of the {{tds}} *tdsGeyser* in the ASCII file `"newfile.C"` A format "Header". {{ "```{literalinclude} " + parent_dir + "/usermanual/dataserver/files/geysernewfile.C\n" + ":language: none\n" + "```" }} 3. Exports the data of the {{tds}} *tdsGeyser* in an ASCII file `newfile.nemo` with format *NeMo* with *x1:x2* as input vector, *"y"* as output and applying a filter "x2<75.0" {{ "```{literalinclude} " + parent_dir + "/usermanual/dataserver/files/geysernewfile.nemo\n" + ":language: none\n" + "```" }} 4. Exports the data of the {{tds}} *tdsGeyser* in an ASCII file `newfile.json` with format *JSON*. {{ "```{literalinclude} " + parent_dir + "/usermanual/dataserver/files/geysernewfile.json\n" + ":language: none\n" + "```" }} ```{admonition} Summary: Exportation of a {{tds}} to ASCII format - `exportData` ( __const char\*__ filename, __const char \*__ varexp="\*", __const char \*__ select="" ) Exportation of the data of attributes *"varexp"* of the {{tds}} in the file *"filename"* in ASCII format, **"Salome table"** type, applying the filter contained in *"select"*. The filter "select" is added to the permanent selection (*c.f.* [](#dataserver_data_pattern_selection)) of the {{tds}}. - `exportDataJSon` ( __const char\*__ filename, __const char \*__ varexp="\*", __const char \*__ select="" ) Exportation of the data of attributes *"varexp"* of the {{tds}} in the file *"filename"* in JSON format, applying the filter contained in *"select"*. The filter "select" is added to the permanent selection (*c.f.* [](#dataserver_data_pattern_selection)) of the {{tds}}. - `exportDataHeader` ( __const char\*__ filename, __const char \*__ varexp="\*", __const char \*__ select="" ) Exportation of the data of attributes *"varexp"* of the {{tds}} in the file *"filename"* in ASCII format for the use of a *C/C++* program. The "select" filter is added to the permanent selection (*c.f.* [](#dataserver_data_pattern_selection)) of the {{tds}}. - `exportDataNeMo` ( __const char\*__ filename, __const char \*__ varexpinput, __const char \*__ varexpoutput, __const char \*__ select="" ) Exportation of the {{tds}} data in the file *"filename"* {{tds}} in ASCII format **NeMo** with attributes *"varexpinput"* as inputs (separated by the character ":") and attributes *"varexpoutput"* as outputs (separated by the character ":") and applying the filter contained in option. The "select" filter is added to the the permanent selection (*c.f.* [](#dataserver_data_pattern_selection)) of the {{tds}} ```