Tag Info

Hot answers tagged

29

Here is a manual method using copy-and-paste that is suitable for small volumes of data on an ad hoc basis... 1) Enter the following expression into a notebook, but don't evaluate it: data = ImportString["", "TSV"] 2) Copy the cells from the source spreadsheet onto the clipboard. 3) Paste the contents of the clipboard between the empty pair of quotes in ...


7

If you are familiar with AppleScript, you could try an approach like this: (* from http://github.com/fmeinberg/AppleScript *) AppleScript["RunFile", file_] := Run["osascript " <> file] AppleScript["RunScript", script_] := Block[{file = ToFileName[$TemporaryDirectory, "script.txt"]}, Export[file, script, "String"]; AppleScript["RunFile", file]] ...


7

Copying my answer from SuperUser: 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. See this page for 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 ...


6

This imports a whole sheet: Grid[#, Dividers -> All] &@ Import["http://joliclic.free.fr/html/object-tag/en/data/test.sxc", {"Data", 1}] And this imports three contiguous rows and two non-contiguous columns: Grid[#, Dividers -> All] &@ Import["http://joliclic.free.fr/html/object-tag/en/data/test.sxc", {"Data", 1, Range[1, 3], ...


4

The simplest thing to try would be to just import one sheet at a time. Do you see crashes even when only importing one sheet at a time? If that still crashes I see several things you could try and am not sure which would work best for you: Use .NET/Link and COM You could use .NET/Link to access excel via COM if you are on Windows to do what you want. But ...


4

Notice that you can use Import["file.xlsx", {"Data",k,m,n}] to import data at cell {m,n} on k-th sheet in the file. To import a range of data, simply replace number m and n by a range list, e.g. Import["file.xlsx", {"Data",1,Table[i,{i,3,8}],{1,2}}] will import data from row 3 to 8, columes 1 and 2 from 1st sheet in your data file, giving you a 6*2 list. ...


3

This is not a complete answer but has too much for a comment. I don't have Numbers so do not know what is in the file you linked but the following information can be obtained: Import["PathTo/example.numbers", "ZIP"] (* {"QuickLook/Thumbnail.jpg", "buildVersionHistory.plist", "index.xml"} *) Now grab the XML: Import["PathTo/example.numbers", ...


3

Save your import result to a variable and check its structure. You will notice that importresult[[1]] is a List (representing the first row, the header in this case). Thus, if you use "" as the pattern for DeleteCases, it will match nothing because in level 1 of importresult there cannot be an empty string anywhere. You could tell DeleteCases to operate on ...


3

I reported this to Wolfram Research and it has been classiefied as a bug. No word on a fix.


2

Assuming the XLS file is in this URL: url = "http://statlinks.oecdcode.org/982013061P1T001.XLS"; This gives you the list of sheets in the XLS file sheetslist = Import[url, {"XLS", "Sheets"}]; And you can Import the second sheet by Import[url, {"Sheets", sheetslist[[2]]}] Backtracking, now to get that URL... Get a list of links in the page: ...


1

Here is an Excel VBA function that will generate the list in an excel cell. Copy the cell and paste directly into mma: Function ToMathematicaList(Y_Values, X_Values) N1 = Y_Values.Count stout = "{" For J = 1 To (N1 - 1) stout = stout & "{" & X_Values(J) & ", " & Y_Values(J) & "}," Next J stout = stout & "{" & X_Values(N1) ...


1

The documentation doesn't indicate if you can specify the number of rows/columns and that would be really useful. I was wrong! Its a simple case of the Excel spreadsheet import info not having an example using spans. To clarify, here is how I let users pick a top left cell to get the data in Row 3 to 28, Column D to L: d = ...



Only top voted, non community-wiki answers of a minimum length are eligible