cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

MC15 READFILE bug?

ifomenko
15-Moonstone

MC15 READFILE bug?

I created delimited text file (XYData.dat) by means of python sentence '\t'.join(seq)+'\n'

I`m trying to read delimited text file by means of READFILE command without success.

 

I can`t understand why tab symbols have different length (I discover this in Notepad+), may be this is the reason.

And I can`t understand why MC separate commas in my strings (x,y,z becomes x y z).

Data import wizard works good!

Here attached two files for reference.

Thanks in Advanced

1 ACCEPTED SOLUTION

Accepted Solutions

Hi, 

It is not a bug.  Delimeter according to help must be consistent.  You have a mix of commas and tabs.

Also the headings has twelve columns but the data has 36 columns this fools the import.

 

Seperate the headings and data into two files.  Use a text editor to replace tabs by commas so delimiter is constant and then read the files

Capture.JPG

View solution in original post

3 REPLIES 3

Hi, 

It is not a bug.  Delimeter according to help must be consistent.  You have a mix of commas and tabs.

Also the headings has twelve columns but the data has 36 columns this fools the import.

 

Seperate the headings and data into two files.  Use a text editor to replace tabs by commas so delimiter is constant and then read the files

Capture.JPG

Thank you vary much for very clear explanation (better then in MC help). At this time I don`t need to use readfile in program block, so I can use data import wizard which works good. Fortunately MC prime has argument for delimeter.

Unfortunately there is no way to tell Mathcads READFILE which character should be considered the delimiter and so its gets confused by spaces, tabs and commas. Looks like Mathcad decided that the comma shoul be the delimiter.

 

One way to deal with the problem is to create a different data file which is more consistent concerning delimiters or postedit the created file and split it even in two files as Terry suggested.

If you don't need the Header information in Mathcad, you could simply use READPRN with the file you already have.

Bild.png

P.S.: The effect has nothing to do with the different sized tabulator "arrows" you see in Notepad+. Notepad+ is simply drawing an arrow to the nex tab stop, which, if you haven't changed the default values, is every 4 characters.

 

Top Tags