Group Abstract Group Abstract

Message Boards Message Boards

0
|
4K Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Exporting table of numbers in decimal format

Posted 2 years ago
POSTED BY: Georg Rohringer
3 Replies

Does something like this help?

Export["Gimp_large2.dat", gbeta1[[1]] /. x_Real :> ToString@FortranForm@x, "CSV"]
POSTED BY: Ian Williams

Thanks, your suggestions works but there is still the problem that small numbers are represented in scientific notation (like 1e-6) in the output. However, I found today by myself another way which gives me exactly what I want:

gtabU0beta = 
 SetAccuracy[
  Table[{NumberForm[nu[j, 1.0], 
     ScientificNotationThreshold -> {-20, 20}], 
    NumberForm[0.0, ScientificNotationThreshold -> {-100, 100}], 
    NumberForm[-1.0/nu[j, 1.0], 
     ScientificNotationThreshold -> {-100, 100}]}, {j, 0, 29999}], 16]

So I use just the number form for my output and set a threshold for scientific notation. This gives me in the export file exactly what I need when exporting the data set as "Table".

POSTED BY: Georg Rohringer

Neat - I’ve not come across SetAccuracy before. Another useful nugget to stash away for future use.

POSTED BY: Ian Williams
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard