1
$\begingroup$

I want to read data from files with an unusual extension with the Import function. However, the following message appears:

format error

The data is well organized, when I rename the extension to ".dat" Mathematica reads it as expected. Can I change the allowed formats and include this ".data"?

$\endgroup$
3
  • 1
    $\begingroup$ Use the second argument of Import to specify the format? $\endgroup$
    – kglr
    Aug 4 '19 at 19:24
  • 2
    $\begingroup$ ... i.e., Import["proton"<>"Dauau1525-401.data", "Table"]? $\endgroup$
    – kglr
    Aug 4 '19 at 19:25
  • 8
    $\begingroup$ Don't rely on Import auto-detecting the format. Specify the format explicitly (2nd argument of Import). $\endgroup$
    – Szabolcs
    Aug 4 '19 at 19:26
1
$\begingroup$

Use the second argument of Import to specify the format explicitly, e.g.,

Import["proton"<>"Dauau1525-401.data", "Table"]
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.