I know how to get a program to read a raw text file that has been piped to it, and do some simple things like counting letters, but I don't know how to read the actual words and store the entire word as a string.
For example, if a text file is (all words and values are separated by a tab):
Tree Branches Leaves Height
Cedar 12 80 100
Pine 9 70 80
Maple 15 100 120
How do I then assign the word (string) to a value, and then assign the word Branches to a different value?
All my previous attempts have just been able to either look at the entire text file as one string, or an entire line at a time as one string.
So basically what I'm asking is how do I assign just one word at a time within a line to a value which can later be recalled?
Is something like this on the right track?:
textfile = open("file.txt").read() words_list = list(textfile)