Group Abstract Group Abstract

Message Boards Message Boards

How to import / read a txt file of numbers into a vector

GROUPS:
I have a large number of integers in a TXT file, each number on a separate line with no leading or trailing spaces.  How do I get this intoa vector, please?  I have tried Help and a variety of commands but none of them give me a vector or any helpful error messages.  Needless to say, it's the first time I've tried to do this.
POSTED BY: John Mycroft
Answer
3 months ago
What have you tried?  Could you post a small version of your TXT file here?  Hard to help with no detailed information. 

But, you should try something like
Import["your path here","Table"]
POSTED BY: David Reiss
Answer
3 months ago
Thanks!  That worked perfectly - goodness knows why it didn't originally.  Now I have a new problem but I guess I should start a new thread.
POSTED BY: John Mycroft
Answer
3 months ago