Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I am pasting a region from MS Excel, which contains multiple numbers, to Mathematica, I am getting just a long plain sequence of digits, i.e. one integer number in Mathematica.

How to have a table of some sort, i.e. separated values?

share|improve this question
    
I updated Mr.Wizard's answer with detailed instructions on how to paste from Excel using my palette. The edit will appear as soon as it is approved. –  Szabolcs Jan 10 '12 at 9:11

2 Answers 2

I am not familiar with the Excel clipboard format, but there is a lovely suite of tools for pasting tabular data in the form of a Palette. Open this page to access the code. When you evaluate that block of code, you will get a Palette with three buttons for different formats. I think there is a good probability that one of the three will do what you want.

You can save the Palette to your user Mathematica\SystemFiles\FrontEnd\Palettes directory and it will appear in the Palettes menu.


How to paste from Excel in practice

An important thing to know about the Windows clipboard is that it can hold data in several formats simultaneously. When you copy from Excel, the data gets copies in several formats, so it can be pasted into many different applications. Unfortunately, when you paste into Mathematica, the wrong format gets automatically chosen. It is not possible to remedy this from Mathematica directly.

The workaround is to first paste into Notepad, select all the text again (CTRL-A), the re-copy it as plain text format only. Now you can paste it into Mathematica using the palette's TSV or Table buttons.

share|improve this answer
1  
@Szabolcs, thanks for the edit. This should have been your answer and your reputation points. –  Mr.Wizard Jan 11 '12 at 4:13
1  
Welcome back! I don't care about reputation any more. ;-) Now I'm the one who's leaving (today), will be absent for a while. –  Szabolcs Jan 11 '12 at 7:59
    
@Szabolcs okay, I'll try to pick up some of the slack while you're away. I hope it is for something pleasant. –  Mr.Wizard Jan 12 '12 at 7:17

It's not possible to paste data from Excel to Mathematica without additional software like "Mathematica Link for Excel". But you could import the data in Mathematica. See f.e. XLS Import.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.