Message Boards Message Boards

0
|
6166 Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Import a specific column from a CSV file?

Posted 3 years ago

I used Data [All, column number]. But the whole table appeared. Not just the column I would like to extract. Thank you very much for your time!

POSTED BY: Yuening Zhang
4 Replies
Posted 3 years ago

Thank you, Rohit. It worked! It was bibliographic data (publication time, title, author name...).

POSTED BY: Yuening Zhang
Posted 3 years ago

Hi Yuening,

What is Data? To Import a specific column from a CSV file

Import["ExampleData/TreesOwnedByTheCityOfChampaign.csv", {"Data", All, 3}] (* column 3 *)
POSTED BY: Rohit Namjoshi
Posted 3 years ago

Thank you, Jim. Seems I still got the entire table as output.

POSTED BY: Yuening Zhang
Posted 3 years ago

Try double square brackets: Data[[All, column number]].

POSTED BY: Jim Baldwin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract