How to export vertices' locations in a .dat file?
Animation Nodes
You can use Animation Nodes to get such information and write it to a file. First, loop over the polygon indices and get the vertices locations at those indices, then get the individual numbers of the vectors, convert them to text and join them using as space as a separator:

Then join the output using a linear break as a separator:

Then you can write the text to a text block using the Text Block Writer Node:

Save the text and you are done.
Python
This script will write the data to the text block test.dat:
import bpy

mesh = bpy.data.objects['Icosphere'].data
data = &quot;&quot;

for poly in mesh.polygons:
    for vert in poly.vertices:
        for c in mesh.vertices[vert].co:
            data += str(c) + &quot; &quot;
    data += &quot;\n&quot;
    
if not &quot;test.dat&quot; in bpy.data.texts:
    bpy.data.texts.new(&quot;test.dat&quot;)

bpy.data.texts['test.dat'].write(data)