Questions tagged [import]

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

Filter by
Sorted by
Tagged with
59
votes
9answers
12k views

How do you convert a string containing a number in C scientific notation to a Mathematica number?

Suppose I have a string containing the C-representation of a floating point number; for example s = "1.23e-5" and I want to convert this to a Mathematica number. ...
98
votes
3answers
12k views

Recovering data points from an image

Unfortunately, some data can only be obtained in picture form (Japanese publications anyone?). Since this cannot be worked with, it has to be converted to a dataset that can; I was wondering whether ...
43
votes
4answers
6k views

Importing videos in Mathematica

Mathematica's Import command is purportedly able to import .AVI files. However, I find that many files that I want to import do only result in MMA showing a blank ...
48
votes
5answers
9k views

How can I extract data points from a black and white image?

Consider the following graph (source): Is there any way to extract the data points from this image in a semi-automatic way? I have seen, and tried the methods suggested in this question, but they did ...
27
votes
3answers
3k views

Reading periodic elements from a large file

I have a large binary data file (big endian) with 100+ million "rows" of 11 elements, combination of floats and integers. This is the format: ...
36
votes
5answers
16k views

How to import all files of a folder at once?

I know how to import one textfile by calling its name filestring = Import["myfile.tex", "Text"]; Then "filestring" is a string with the myfile content. How do ...
19
votes
2answers
6k views

Speeding up Import and Export in CSV format

I am handling large numerical data in Mathematica. In smaller problems everything worked fine using Export and Import with the ...
32
votes
3answers
2k views

How to place an image inside a notebook, with the minimum memory footprint?

When creating a notebook with images, like photos, the file tends to quickly get big, which makes it difficult to use the notebook format for training material containing a lot of images. Are there ...
40
votes
2answers
6k views

How to build a bvh (a motion capture file format) player in Mathematica?

How to build a bvh player that can be used to visualize human motions in Mathematica? Any idea or sample code would be appreciated. ...
24
votes
4answers
2k views

ReadList problem related to Record type

A simple file reading issue is baffling me here. I am reading a around 200 MB textual file in .dat format. Now the file contains many lines but to phrase my problem ...
28
votes
3answers
2k views

DumpSave for the forgetful

A few weeks ago I created a big matrix, and in order not to have to recreate it, I stored it using DumpSave["file.mx", variable]. Now I want to read it back in and ...
15
votes
2answers
529 views

How to workaround failures with Unicode filepaths?

(Cross-posted on the Wolfram Community, reported to the support as [CASE:3965891].) The Mathematica's Kernel and FrontEnd currently work well with Unicode file/directory paths, but some other ...
13
votes
2answers
2k views

How do I display imported images at actual size?

I know that this is an extremely basic question, but I am having a lot of trouble finding the answer in the documentation. When I import an image (for example, ...
8
votes
3answers
8k views

Importing multiple files using a for-loop

once again I am stuck solving a seemingly easy problem :( I would like to make a List of tables by importing data from several txt-Files. Importing the data into a table works so far and I am able to ...
33
votes
3answers
5k views

How to read data file quickly?

I have a tab separated value file with 10 million rows each of which has three tab separated values. The first value is a string, the second an integer, and the third another string. How to read ...
1
vote
1answer
614 views

How can I speed up image importing? [closed]

The following examples show how slow it is to load a simple GIF. Can anything be done to make it faster? System #1: Mathematica 8.0.1.0, HP notebook, Win7 64Bit, 2 x 2.4Ghz Intel Core i5, 2GB RAM, w/ ...
33
votes
2answers
7k views

How to save all data in all variables so that loading it is fast?

I've got this CSV file I've imported that has tens of millions of lines in it. It takes around 20 minutes to import. I've been working with it for a while and have the processed data spread out in a ...
36
votes
5answers
8k views

How can I import a huge CSV file quickly?

I have two CSV files, each one is around 1 GB of data. When I use Import["file.csv"], it takes a very, very, long time to import the data. So how can I accelerate ...
30
votes
3answers
3k views

How to manipulate web pages on Mathematica?

I wanted to input some data on this page through Mathematica. Then I would press the "buscar" button also through Mathematica coding and get the results on Mathematica. The most similar post I've ...
24
votes
4answers
3k views

Is it possible to use Mathematica to record sound and/or vision?

I think the title says it all. I know about ImageCapture which seems to capture stills. Can ImageCapture be made to capture a ...
23
votes
3answers
3k views

Who is to blame: parsing UTF8 encoded JSON HTTPResponse fails

Bug introduced in 11.0 or earlier and persists through 11.3 (confirmed by WRI Support but read summary below) Answers summary I think we need a quick summary here to justify keeping bug. Original ...
11
votes
2answers
6k views

How to get MATLAB data imported with the same dimensions?

I have some MATLAB image data with the following dimensions (output is from MATLAB): >> size(im) ans = 86 86 3 45 The data imports just fine ...
29
votes
3answers
4k views

Extracting values from nested rules in JSON data

I have been using Mathematica to analyse some data from the StackExchange API. It is conveniently available in JSON form, which Mathematica interprets as replacement rules. However, some of the rules ...
19
votes
4answers
9k views

Skip header lines on import

When importing a data file what are the comment symbols for Mathematica? That is, given a file like this blabla bulbul 1 2 6 54 7 ... .. what symbol do I have ...
11
votes
2answers
2k views

Stream CSV or TSV files

RAM limitations make import impractical for large CSV files. Is it possible to Stream CSV correctly? str = OpenRead["EU.csv"]; Read[str, "CSV"] Read::readn: ...
20
votes
3answers
26k views

Plot data from txt file?

I have data in file.txt which can be expressed by 20000x11 matrix. I do not want to import all of these data. How can I plot graph of the column 1 & column 4?
29
votes
5answers
3k views

Fetching data from HTML source

I want to generate a couple of plots/graphs with Area 51 statistics. Since Area 51 doesn't work with the SE API, I'm forced to find another way to get the information I want. That other way is with <...
25
votes
4answers
3k views

How to efficiently import videos

I need to do frame-by-frame analysis of videos. I can import the video files I need, but each file is too large to import at once. I can use the ...
16
votes
3answers
1k views

Is it possible to insert an animated image into Mathematica notebook?

I find it very convenient to use Mathematica notebooks to organize the codes + results. I was wondering if it is possible to insert an animated image (say an animated gif) in the middle of a notebook....
10
votes
1answer
717 views

Mathematica 10 doesn't support path containing Chinese characters

Bug introduced in 10.0 and fixed in 10.0.2 I tried to import file in Mathematica 10 ( windows 7 system), the path contains some chinese characters. After holding ctrl+shift, and drag the file into ...
2
votes
1answer
1k views

Import Excel sheet into 3D array?

I have an excel spreadsheet that I would like to plot in a 3D graph using mathematica. The X and Y values are the location of the cell, and the Z value is the number of the scale. How can I import ...
0
votes
3answers
879 views

Importing multiple files with a loop

I have 101 files with data that I want to import into Mathematica. All the file names are numbered as follows datafile.20.0000.out, datafile.20.1000.out, datafile.20.2000.out and so on. I used the ...
13
votes
2answers
1k views

Google Image Search in Notebook?

How can I use Google's image API to custom search for images and import them all?
14
votes
2answers
5k views

Difficulties with Importing PDFs in Mathematica

I am trying to import a group of PDFs that I have downloaded (it is in the realm of 1,000+). They are a group of doctoral dissertations that I'm trying to automatically extract bibliographic ...
18
votes
2answers
3k views

Dealing with large files

I have a *.dat file in which the contents are basically one giant list: {1,2,3,4} {5,6,7,8} {9,10,11,12} and so on. I'd like to read in the first 500 members { }...
15
votes
3answers
5k views

How can I transfer mathematical expressions between Mathematica and Maple?

Is there a simple way to copy mathematical expressions between Mathematica and Maple (or at least in one direction)? I mean only expressions built from numbers and predefined mathematical functions, ...
19
votes
1answer
2k views

Release the web camera after using CurrentImage[]

CurrentImage[] will capture an image from the webcam. It is even possible to create a live video in the notebook using ...
15
votes
3answers
2k views

How to scrape the headlines from New York Times and Wall Street Journal?

How to scrape headlines from New York Times, Wall Street Journal main pages to create datasets similar to this service? Importing HTML from nyt.com (HTML4) results in a ...
16
votes
1answer
768 views

Importing Zip files

Mathematica can import zipped files automatically, but when the content of the zip file it's another zipped file, I just get the list of files in the second zip: ...
11
votes
3answers
1k views

Is it possible to import dates and times directly as AbsoluteTime and by pass DateLists?

Date and time calculations are quite slow so I am exploring ways to minimize the number of calculations performed. As an example: ...
7
votes
1answer
3k views

Combine multiple PDF files into one document

I have multiple single page PDFs I'd like to join together into a single file. (Obviously I mean the file format and not the probability distributions here!) I'm aware of free online services such as ...
4
votes
3answers
1k views

Importing CSV with multiline text fields

Bug introduced in 8 or earlier and fixed in 11.2.0 Here is a valid CSV: a1,b1,c1,d1,"e1 e1 e1" a2,b2,"c2 c2 c2",d2,e2 It has two rows and five columns, and ...
14
votes
1answer
305 views

Import package with correct symbol contexts

I am looking to do some automated analysis on packages, e.g. automatically check for common mistakes. Mathematica makes it relatively easy to manipulate code as data, and ...
8
votes
1answer
2k views

Why does Export drop namespace prefixes in the exported XML file?

I am trying to generate an Excel-compatible XML file from Mathematica. First, I created a test XML file by saving a Microsoft Excel workbook as "XML Table". Then I ...
5
votes
1answer
1k views

ReadList can't read from file containing high-precision Reals

I want to read a file which contains seven columns of real numbers. Mathematica seems to have a problem with the high precision I need. My code: ...
1
vote
1answer
441 views

Is there a better way to download images in parallel?

Is this the best way to batch save a list of image urls in parallel? ...
-1
votes
1answer
3k views

import Excel sheets by name

I'm importing data from Excel. It appears that the sheet number needed in the Import statement is taken from the order that the sheets appear in the open Excel file. I need to import 2 of the sheets ...
26
votes
3answers
2k views

Finding a function that fits the shape of an image

How can I find a function that fits the given shape of an image? Or instead extract a point set from the shape and then find an interpolating function fits the shape. An example image is attached.
20
votes
1answer
3k views

Is it possible to extract data from an EPS plot not generated in Mathematica?

I want to extract data from an EPS plot not generated in Mathematica and replot it. In general is it possible to extract data from plots in any formats in Mathematica? I searched but unfortunately ...
13
votes
1answer
481 views

How to use RunProcess to import external function?

I have a functions written in an external language called GO. How can I quickly load them into the kernel for use as Mathematica functions? The two ways I've tried are with MathLink and LibraryLink ...