Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have an EXCEL file in which large amount of numbers is stored in a column in the first sheet, like data in the column A of the sheet1 of excel file. When I apply the Import function; the data is imported into Mathematica like this: {{{1},{2},{3}}}. But I want them to be in form of a one dimensional table or array like: {1, 2, 3}. How is this possible?

share|improve this question

closed as off-topic by Öskå, Yves Klett, m_goldberg, Michael E2, Sjoerd C. de Vries Jun 16 at 16:43

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." – Öskå, Yves Klett, m_goldberg, Michael E2, Sjoerd C. de Vries
If this question can be reworded to fit the rules in the help center, please edit the question.

Have you tried Flatten? Or are you looking for a solution with Import? –  Öskå Jun 16 at 14:39
No, I tried the Transpose syntax. But it made the thing not any better. –  Enthusiastic Student Jun 16 at 14:41
Can you please provide a text sample of a XLS file? –  Öskå Jun 16 at 14:42
Flatten syntax did work. Thanks. :) Can you please write your comment in form of an Answer, so I can check mark/accept your solution? –  Enthusiastic Student Jun 16 at 14:43
I'm afraid that your answer will be closed as it's in the documentation :) But I'm glad I helped :) –  Öskå Jun 16 at 14:44

1 Answer 1

up vote 1 down vote accepted

Save the Excel sheet as .csv


a = Import["C:\YourPath\column.csv"]

{{1}, {2}, {3}, {4}, {5}}

a // Tableform

enter image description here

a // Flatten

{1, 2, 3, 4, 5}

share|improve this answer
Saving the as .xlsx also worked. Does saving like that adds any benefit? –  Enthusiastic Student Jun 16 at 14:53
@user52417 - .xlsx changes the integers to reals. Also, .csv is faster with large files. –  eldo Jun 16 at 14:57

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