Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 245

Questions about getting data, files, images etc. from various formats into a form that can be read, tranformed and manipulated by Mathematica

2
votes
The problem description sounds as if you're in fact trying to import something into Mathematica that is more appropriately classified as a .m format, i.e., a "Package". Let's say your text file … contains the single entry Pi and its name is Pi.txt - then you could simply import it as follows: variable = Import["Pi.txt", "Package"]; Now variable contains the value Pi. Moreover, your text file …
answered Jul 14 '12 by Jens
9
votes
directory (or the current working directory of your notebook). dataContent = Import["data.dat"] (* ==> {{"X", "Y"}, {0.001, 12.51}, {0.0015, 12.01}, {0.002, 11.44}, {0.002484, 10.88}, {0.002484, 10.88 … ] (* ==> {"X", "Y"} *) ListLinePlot[dataPoints, Frame -> True, FrameLabel -> labels] By the way, if you don't want to see the long list output after the Import command, end the line with a …
answered Mar 24 '13 by Jens
14
votes
If it's really scanned images, then you could try this: pages = Import["yourfile.pdf", {"PDF", "Images"}] Otherwise, I'd suggest running the file through ghostscript or another distiller to clean …
answered Mar 10 '12 by Jens
7
votes
One possibility would be to create a notebook cell containing the imported data in Compressed form: testData = RandomReal[{0, 1}, {100, 100}]; Export["file.csv", testData]; f = Compress[Import
answered Apr 11 '15 by Jens
2
votes
There is no problem importing base-64 encoded images into Mathematica. Here is an example: a = Import["ExampleData/rose.gif"]; Export["a.b64", a, {"Base64", "PNG"}]; Import["a.b64", "Base64 …
answered Apr 4 '13 by Jens
5
votes
this: Export["test1.hdf", {{{1, 1}, {2, 2}}, {{3, 3}, {4, 4}}}]; Import["test1.hdf", {"Datasets", "Dataset1"}] (* ==> {{{1, 1}, {2, 2}}, {{3, 3}, {4, 4}}} *) …
answered Dec 12 '12 by Jens
5
votes
The regular expression approach is my favorite, but I would do it a little differently to make it more robust. The approach by David didn't quite get the } treated right. The approach by R.M relied on …
answered Apr 29 '12 by Jens
5
votes
more recent versions of the PDF specification (1.5), whereas Mathematica expects an older version upon import (probably 1.3). Specifying the lower version by adding \pdfminorversion=3 as the first line … import handling: Run["gs -sDEVICE=pswrite -dNOCACHE -sOutputFile=- -q \ -dbatch -dNOPAUSE -dQUIET words.pdf -c quit | ps2pdf - wordNew.pdf"] (* ==> 0 *) Import["wordNew.pdf"] To tie this together …
answered Dec 26 '12 by Jens
6
votes
]]], TrackedSymbols -> {}], {"MouseUp", 2} :> Null]] makeAnimation[ Import["ExampleData/cellularautomaton.gif", "ImageList"]] You can copy this animation by selecting its cell bracket. It's persistent across notebooks, too. …
answered Aug 14 '13 by Jens
6
votes
that could make or break any attempt to even import the images into Mathematica is this (your question already does this, but I think it bears repeating): Always end your Import statement with a …
answered May 28 '12 by Jens
9
votes
You have to specify the correct character encoding: Export["hello.txt", {t, r, θ, ϕ}, "List"]; old = Import["hello.txt", "List", CharacterEncoding -> "UTF8"] (* ==> {"t", "r", "θ", "ϕ"} *) …
answered Jul 28 '13 by Jens
5
votes
To make the path permanently available to Mathematica (frontend) and all other applications, first find out the location of your desired python3 executable (e.g. from which python3 in the Terminal), a …
answered Jul 16 '17 by Jens
7
votes
Here is another approach using a background to prevent cropping of the rotated image when its aspect ratio is far from 1: im = Import["http://i.stack.imgur.com/pyNu2.png"] im2 = SetAlphaChannel …
answered Mar 18 '13 by Jens
5
votes
It's true that there is a problem in Mathematica version 7. I just remembered that I noted this here: outlining of glyphs on import as PDF is buggy in version 7. The confusing thing is that Import … sets the option "TextOutlines" -> True so that outlines are indeed produced unless I specify "TextOutlines" -> False in the Import command. For example, try (note that I corrected the single backslash …
answered Aug 2 '12 by Jens
10
votes
To import as XMLObject is probably the cleanest approach, but since you asked for pattern matching I'll also post my answer which is similar to @nixeagle's but extracts instead the values together … with their labels: src=Import["http://area51.stackexchange.com/proposals/4470/martial-arts","Source"]; StringCases[src, RegularExpression[ "<div\\s*class=\"site-health-value\">(.*)</div>\\s*<div …
answered Mar 23 '12 by Jens

15 30 50 per page