My data is in the form of 6 columns in a notepad file. I want to import, only from a specific column,say, the third column into Mathematica in the form of a list, i.e., i want commas to be placed after each data points. Thanks in advance!

  • $\begingroup$ Hi, welcome to Mma.SE! What have you tried? Have you looked into using Import? You are more likely to get help if you show what you've tried and explain, if necessary, what was unsatisfactory. $\endgroup$
    – Michael E2
    May 29 '13 at 17:39
  • 2
    $\begingroup$ How about importing all data and then using only the third column of your data with Part (see Mathematica help)? $\endgroup$
    – partial81
    May 29 '13 at 18:10

Assuming a tab-seperated dataset like this:

2 3 4 5 6 7

3 4 5 6 7 8

4 5 6 7 8 9

Import["file path", "TSV"][[All, 6]]


For comma-seperated data replace "TSV" with "CSV" (or "Table" for space-separated data). As Michael E2 suggested, this is explained here. General information on importing and exporting is here.

If you really only want the sixth column to be displayed in the notebook (i.e. not linked to the original data import) then put the cursor at the start of the output cell and assign a new variable name to it (e.g. col6 = {7,8,9}). Then you can delete the original list. Though this is a lot of effort for minimal benefit..


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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