Delimited Output With Matlab to Textfile

I have the following line of code:
dlmwrite('tempfile', exportData(i).array, '-append', 'delimiter', '\t', 'precision', 6);
to export a dataset to a text file delimited by tabs. The issue I am running into is when opening this in notepad (which is how it has to be done) the third column of data runs into the first when the third column's value becomes a very small number as an example the output in notepad looks like this:
0.002375192504.5
another example:
8.5675e-0055249.5
with no tab and I need it to look like:
0.00237519 2504.5
8.5675e-005 5249.5
or:
0.00237519     2504.5
8.5675e-005    5249.5
Does anybody know how to do this keeping the precision level at 6 and still ensuring there is a tab in between?

Thanks.
kpurchaseAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

yuk99Commented:
Try to add dlmwrite(...,  'newline', 'pc')

Do you run this under Windows or Linux? How the file looks if you open it in another, not Notepad? For example, MATLAB editor?
yuk99Commented:
Will it work if you use comma as a delimiter?
kpurchaseAuthor Commented:
It looks fine with wordpad, and cannot use comma delimitation unfortunately. Do I add the newline aspect at the end of the dlmwrite statement? And this is run on Windows.
yuk99Commented:
Yes, add newline as a parameter pair:
dlmwrite('tempfile', exportData(i).array, '-append', 'delimiter', '\t', 'precision', 6, 'newline','pc');

You don't have to use comma, just try it to see that delimiter is inserted correctly.

However, if you see the data correctly in Wordpad, it means that delimiter is inserted. It's Notepad doesn't show the file correctly, may be because of wrong newline character.  

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.