6
1
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?
6
1
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?
6
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.
1@Szabolcs, thanks for the edit. This should have been your answer and your reputation points. – Mr.Wizard – 2012-01-11T04:13:54.080
1Welcome 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 – 2012-01-11T07:59:56.877
@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 – 2012-01-12T07:17:02.110
3
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.
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 – 2012-01-10T09:11:18.833