I am looking for a free way to get a large amount of data on the prices of stocks. I am not a trader or anything like that so it wouldn't be worth it to pay for a service to give me stock prices. I have a mathematics background and I would like to make my own determinations of what stocks to invest in. To do this, I need some data.
Is there any free place online to download data on various stock prices over the last few years?
I would probably like to do this for a few stocks so it would be good if it could somehow be in a text file or a csv rather than having to type it out myself.
I know there are websites that crunch the numbers for you but I would prefer to do it myself.
EDIT: If there aren't any free services, where should I look for cheap ways to get the data I need?