Note: You are currently viewing documentation for Moodle 2.3. Up-to-date documentation for the latest stable version is available here: Database export.

Database export: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 2: Line 2:
<p class="note">'''Please refer to [[TOC_with_notes#Database|these notes]] before editing this page.'''</p>
<p class="note">'''Please refer to [[TOC_with_notes#Database|these notes]] before editing this page.'''</p>


The [[Database_templates#List_template|list template]] can be used to export your database as a CSV file in the following way. It is assumed that you have a database with N fields, and that in this example the fields are named field1, field2 ... until fieldN.
== Choose the format you wish to export to ==


The Database activity module provides an Export tab that allows users to export database entries to either the CSV (comma separated values) or ODS (OpenOffice Calc) formats. Previously, it was possible to export to the XLS (Microsoft Excel) format; however, problems with creating that format have led to it being removed. The workaround is to use either CSV or ODS formats both of which can be opened with the latest version of Microsoft Excel.


== Header ==
When using the CSV format, the user can select either the comma, semicolon, or tab to separate the fields. The selection of the proper character is important. If users select to use a comma to separate the fields and some of the fields contain data with commas then the number of columns is going to be misaligned and likely cause confusion.


In the header create a comma separated list of the field names
== Choose the fields you wish to export ==


<pre>
Users can select which fields from the database they wish to have exported. By default, all fields are checked to be included. Choose the fields that you wish to have included in the export.
field1,field2,...,fieldN
</pre>


== Repeated entry ==
== Export entries ==


In the repeated entry create a comma separated list of the field tags
Once the export type and the fields to be exported have been selected, clicking on the Export entries pushbutton will generate the file. The user will usually have the option of either opening or saving the file.  
 
<pre>
[[field1]],[[field2]],...,[[fieldN]]
</pre>
 
Save the template!
 
== Export ==
 
To export, simply select the View List tab and all your data will be in the CSV format. By default only 10 records are displayed, but this can be increased. Copy and paste to your required tool.
 
== Import ==
 
To import, go to the "Add Entry" page - [[Adding_a_database_entry]].


==See also==
==See also==


* [[Adding a database entry]] - including import.
* [[Adding a database entry]] - including import.
* See [http://tracker.moodle.org/browse/MDL-19864|MDL-19864] for errors related to XLS export


[[]]
[[de:Datenbank_Export]]
[[de:Datenbank_Export]]
[[ru:Экспорт базы данных]]
[[ru:Экспорт базы данных]]
[[ja:データベースのエクスポート]]
[[ja:データベースのエクスポート]]
[[Category:Database_activity_module]]

Revision as of 07:35, 30 June 2011

Please refer to these notes before editing this page.

Choose the format you wish to export to

The Database activity module provides an Export tab that allows users to export database entries to either the CSV (comma separated values) or ODS (OpenOffice Calc) formats. Previously, it was possible to export to the XLS (Microsoft Excel) format; however, problems with creating that format have led to it being removed. The workaround is to use either CSV or ODS formats both of which can be opened with the latest version of Microsoft Excel.

When using the CSV format, the user can select either the comma, semicolon, or tab to separate the fields. The selection of the proper character is important. If users select to use a comma to separate the fields and some of the fields contain data with commas then the number of columns is going to be misaligned and likely cause confusion.

Choose the fields you wish to export

Users can select which fields from the database they wish to have exported. By default, all fields are checked to be included. Choose the fields that you wish to have included in the export.

Export entries

Once the export type and the fields to be exported have been selected, clicking on the Export entries pushbutton will generate the file. The user will usually have the option of either opening or saving the file.

See also

[[]]