Message Boards Message Boards

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

Import Large Text Files?

Posted 10 years ago

Just a quick one, any idea if there is a quicker way to import large list files? For instance, i have a 5 column list file, around 20mb, and I want to import only the 2nd and 3rd columns into mathematica to plot. I've tried import, but it runs for far too long and doesn't seem to finish (after about 10 minutes). Anyway of doing this but quickly? I tried ReadList but not really sure how that can give me the right columns?

Thanks,

Lewis

POSTED BY: Lewis Millar
2 Replies
Posted 9 years ago

20mb is a small file. Something else is wrong. I suggest you post an abbreviated data file.

POSTED BY: David Keith
Posted 9 years ago

Hi Lewis,

Data = Import["/filename.csv", "Grid"];
Data[[All, All, {2, 3}]]

Will import the 2nd & 3rd columns from the CSV file, but not any of the other columns. Hope this helps,

Greg


Following commenter correctly points out that the file is small. A visual inspection of the data may be able to find the cause.

POSTED BY: Greg
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