3
$\begingroup$

I have an csv file that I open with excel. In it 2 columns of numbers. I'd like to import it to mathematica and plot it. How can I do ?

$\endgroup$

closed as off-topic by Szabolcs, Henrik Schumacher, Johu, MarcoB, Bob Hanlon Oct 10 '18 at 1:59

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Szabolcs, Henrik Schumacher, Johu, MarcoB, Bob Hanlon
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    $\begingroup$ Mathematica can import CSV files--no need for Excel. Have you search the documentation for "CSV"? $\endgroup$ – Szabolcs Oct 5 '18 at 14:10
5
$\begingroup$

As mentioned in the comment above, the CSV file can be imported programmatically, which has been explained clearly in document of CSV, but I'd like introduce a more user-friendly approach in this answer.

First, copy the data to Mathematica in the following way:

enter image description here

Then plot:

ListPlot@%
$\endgroup$
  • $\begingroup$ @JA: To import data from Excel to Mathematica, you might want to try this: SetDirectory["D:\\mathematicaSNAcode_Tugrul"] where D:\\mathematicaSNAcode_Tugrul is the location of the Excel or CVS files to be imported. Then Import["file name.xls", {"Data", 1}] where Data 1 indicates that the data will be imported from Worksheet 1 in case you have several data worksheets in one Excel file. As Szabolcs indicated, CVS files can be imported in the same way as Excel files. $\endgroup$ – Tugrul Temel Oct 5 '18 at 15:26
  • 1
    $\begingroup$ @Tebernus As to the capture of file name and directory, there exists user-friendly way, too: mathematica.stackexchange.com/a/14741/1871 $\endgroup$ – xzczd Oct 5 '18 at 15:29
  • $\begingroup$ Thanks for the useful link. $\endgroup$ – Tugrul Temel Oct 5 '18 at 18:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.