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 ?
Asked
Active
Viewed 95 times
3
-
3Mathematica can import CSV files--no need for Excel. Have you search the documentation for "CSV"? – Szabolcs Oct 05 '18 at 14:10
1 Answers
5
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:
Then plot:
ListPlot@%
xzczd
- 65,995
- 9
- 163
- 468
-
@JA: To import data from Excel to Mathematica, you might want to try this:
SetDirectory["D:\\mathematicaSNAcode_Tugrul"]whereD:\\mathematicaSNAcode_Tugrulis the location of the Excel or CVS files to be imported. ThenImport["file name.xls", {"Data", 1}]whereData 1indicates that the data will be imported fromWorksheet 1in 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. – Tugrul Temel Oct 05 '18 at 15:26 -
1@Tebernus As to the capture of file name and directory, there exists user-friendly way, too: https://mathematica.stackexchange.com/a/14741/1871 – xzczd Oct 05 '18 at 15:29
-
