Skip to main content
February 21, 2011
Solved

Generate a delimited ASCII file with a data spacer and read it with Excel

  • February 21, 2011
  • 3 replies
  • 3864 views

Dear Mathcad Guru's,

I am using the function

array = augment(vect1, vect2, vect3,..) n vectors in total. Each vector has m rows

to create an array of data of m rows and n columns

The data can be positive or negative

Then I write the array with the command

WRITEPRN(file_name) = array

When I want to read the data with Excel, I open it with the Text Import Wizard, using the delimited option and space (or other) in order to read the various columns.

It happens very often that the text Import Wizard doesn't recognise correctly the columns.

One way to avoid this issue would be to introduce a delimitation (like space, ; or else) between the columns.

I need to be able to read the data with Excel, after I generated delimited (?) ASCII file with mathcad

I have also tried

WRITEFILE(file_name,"Excel"):=array

but it seems not to work ! What did I wrong there

Does anyone knows how to solve this issue ?

Thank you for your help

Best answer by RichardJ

Go to "Tools", "Worksheet Options", "Built-in Variables" tab, and increase the column width. That might fix it.

3 replies

1-Visitor
February 21, 2011

Can you please plot an example of the data?

Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

February 21, 2011

OK, I have joined an example in the form of picture in a ppt file.

I put a picture of waht we can read in a mathcad file and whyt i am getting after importing it in Excel with the Text Import Wizard.

You can see how the Text Import Wizard cannot really identify the data (especially with a minus sign)

Thank you for you help

RichardJ19-TanzaniteAnswer
19-Tanzanite
February 21, 2011

Go to "Tools", "Worksheet Options", "Built-in Variables" tab, and increase the column width. That might fix it.

19-Tanzanite
February 21, 2011
I have also tried

WRITEFILE(file_name,"Excel"):=array

but it seems not to work !

Because there's no such function

23-Emerald I
February 21, 2011

Patrice Bujard wrote:

Dear Mathcad Guru's,

I am using the function

array = augment(vect1, vect2, vect3,..) n vectors in total. Each vector has m rows

to create an array of data of m rows and n columns

The data can be positive or negative

Then I write the array with the command

WRITEPRN(file_name) = array

When I want to read the data with Excel, I open it with the Text Import Wizard, using the delimited option and space (or other) in order to read the various columns.

It happens very often that the text Import Wizard doesn't recognise correctly the columns.

One way to avoid this issue would be to introduce a delimitation (like space, ; or else) between the columns.

I need to be able to read the data with Excel, after I generated delimited (?) ASCII file with mathcad

I have also tried

WRITEFILE(file_name,"Excel"):=array

but it seems not to work ! What did I wrong there

Does anyone knows how to solve this issue ?

Thank you for your help

Mr. Jackson had the answer, I'm merely providing an example