Questions tagged [csv-format]

Questions about the Text based file format CSV (Comma Seperated Values). Questions include, but are not restricted to, importing from and exporting to this file format.

Filter by
Sorted by
Tagged with
20
votes
2answers
7k 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 ...
37
votes
5answers
9k 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 ...
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: ...
7
votes
1answer
1k views

Working with a CSV data file with 100 millions rows (and 30 columns)

I am new to working with large datasets.. Currently I am struggling to upload a "big data" file into Mathematica. The file is in the CSV format and has 14GB. There are 100 millions of rows and 30 ...
4
votes
3answers
2k 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 ...
8
votes
1answer
1k views

Reading specific entries from a CSV file

This question is related to the following: Speeding up Import and Export in CSV format Stream CSV or TSV files Reading periodic elements from a large file I have a set of very large CSV files (a ...
1
vote
3answers
1k views

How to import files with headers?

R has excellent header supports such as read.table with header options. I don't want to mess up with text-processing or stream-processing. I am looking for a similar tool as in R because it saves a ...
6
votes
2answers
2k views

Exporting strings without the quotes

I'm trying to export the following string "sep = ," to a CSV-file, as to be able to define the separation symbol. However, when using the following command: <...
3
votes
2answers
2k views

Interpreting the interpolating function and saving data to plot with external program

So far I have been solving non-linear pdes with NDSolve and then plotting the result with the in-built Plot3D and ...
13
votes
4answers
3k views

Import[ ] drops leading zeros from data when importing a CSV file

I need to load data from the CSV file shown below. Import[ ] drops the leading zeros in column 3 when it imports the CSV file, but they are security identifiers, and I need them. ReadList[ ] ...
12
votes
5answers
2k views

Export a simple DataSet with key-value associations to CSV in Mathematica 10

I'm trying to Export a simple dataset with key-value pairs to a CSV Export["n.csv", MyDataset, "CSV"] This results in a single-line serialization: ...
13
votes
2answers
1k views

Parsing a CSV file using Interpreter

The new Interpreter functionality in version 10 looks like it has the potential to make parsing custom data formats very easy. I'm trying to create a CSV parser. ...
6
votes
1answer
1k views

Efficiently reading CSV with ReadList

I have a large CSV file (~1gb) with mixed data. Basically with strings and integers. It takes very long to import this whole dataset with Import[] so I would like ...
3
votes
1answer
2k views

How do I read a CSV file and remove comments from it

I have very recently started using Mathematica 9.0 Home Edition and am trying to understand it as best I can so please be tolerant ;). I have a file of data (sugar.csv) which contains blood sugar ...
0
votes
2answers
591 views

Exporting a table to Excel in CSV format

I am trying to create a table which when exported in a .csv format and opened in MS.Excel has the following form; ...
8
votes
1answer
7k views

Reading csv/xlsx data into Mathematica with column headings as list names

It's old question. However, I could not find satisfactory answer. Decided to post this question. I have a .csv file with column heading. How can I import this ...
3
votes
1answer
393 views

Writing CSV or alternative

I've tried to export a list to a CSV file. I shut it down after about 20 minutes of processing. The list has 261,000 rows and 30 columns. I finally exported it to a TXT file and its size was 111 MB....
3
votes
3answers
1k views

Why does a certain CSV file import properly into LibreOffice but not into Mathematica 10.0?

I'm working on a project involving data manipulation and it involves working with CSV files. I know that the files are properly formatted as when I import them into LibreOffice, all of the columns ...
0
votes
1answer
795 views

How to export CSV with fixed delimiter and specific format specifier

I would like to export an array to a csv file with a specific type of delimiter and a specific notation of the numbers (in this case scientific notation 1.234E-02). How can I achieve this in a ...
7
votes
1answer
371 views

Incorrect result while using SemanticImport for CSV file import

I might use this incorrectly. I want to use a .csv file that (as list) looks like: ...
3
votes
1answer
5k views

How to export CSV from Mathematica?

I have previously been using logf[x_, y_] := f[x, y] /. v_ :>(PutAppend[Unevaluated[f[x, y] = v;], "out.txt"];); which produces output like ...
2
votes
2answers
430 views

Exporting files while running .m file from command line

I have the following code in a .m file which is called test.m: Export["test.csv",0]; Exit[] I would like to run this .m file from the command line. I found that I can do that with the command "math -...
0
votes
2answers
690 views

Comma issue from number point in csv export!

Here is my issue: I want to export to csv file some data: ...
-1
votes
4answers
667 views

Import vs ReadList CSV file with Currency Values

A testing file with the specified format can be downloaded from here Let's read a few lines from this file ...
1
vote
1answer
460 views

Import image saved as CSV file [closed]

I have saved my image file from ccd camera as a CSV file. How can I plot this file to get my image back? My file is here.