Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6554513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:42:33+00:00 2026-05-25T12:42:33+00:00

I am exporting data from mathematica in this manner to a file with dat

  • 0

I am exporting data from mathematica in this manner to a file with “dat” extension.

numbercount=0;
exporttable =
   TableForm[
    Flatten[
     Table[
      Table[
       Table[{++numbercount, xcord, ycord, zcord}, {xcord, 0, 100, 5}], 
      {ycord, 0, 100, 5}], 
     {zcord,10, 100, 10}],
    2]];
Export["mydata.dat", exporttable]

Now what happens is the “mydata.dat” file the output appears like this

1  0   0   10
2  5   0   10
3  10  0   10  and so on

But I want the data to appear like this in the “mydata.dat” file.

1, 0,  0,  10
2, 5,  0,  10
3, 10, 0,  10  and so on

If you observer I want a comma after every first,second and third number but not after the fourth number in each line.

I have tried this code it inserts the commas between the number But it takes a long time to run as I have huge amounts of data to be exported.I also feel that someone can perhaps come up with a better solution.

numbercount=0;
exporttable =Flatten[
              Table[
               Table[
                Table[{++numbercount, xcord, ycord, zcord}, {xcord, 0, 100, 5}], 
               {ycord, 0, 100, 5}], 
              {zcord,10, 100, 10}], 
             2];
x = TableForm[Insert[
              exporttable[[i]], ",", {{2}, {3}, {4}}], {i, 1, Length[exporttable]}];
Export["mydata.dat", x]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:42:34+00:00Added an answer on May 25, 2026 at 12:42 pm

    Have you tried exporting it as a CSV file? The third parameter of Export is file type, so you’d type

    Export["mydata.dat", x, "CSV"]
    

    To add to this, here is a categorical list and an alphabetical list of the available formats in Mathematica.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Exporting some data from mysql to a csv file using FasterCSV. I'd like the
I am exporting data table from php page to pdf I got the page
I am writing an exporting function to take data from a database table and
Summary: exporting pixel data from NSOpenGLView to some file formats gives incorrect colours I
i;m trying to automate the exporting of data from an sql server table to
I am exporting data from php page to word,, there i get 'n' number
I'm exporting data programatically from Excel to SQL Server 2005 using SqlBulkCopy. It works
I am programmatically exporting data (using PHP 5.2) into a .csv test file. Example
I am using a Windows application for exporting a data table to Excel. It's
I am currently exporting data from php to excel using the code as below:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.