how to export query results to file in sqldeveloper

Tip: Add /*csv*/ or /*xml*/ after ‘Select’ and run it as script (press F5) will generate the result as target format in the output window,

For example, select /*csv*/ * from test_table