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.

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!

share|improve this question
    
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. –  Michael E2 May 29 '13 at 17:39
2  
How about importing all data and then using only the third column of your data with Part (see Mathematica help)? –  partial81 May 29 '13 at 18:10
add comment

1 Answer

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]]

{7,8,9}

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..

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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