PDA

View Full Version : .Txt to Excel?



JTH
12-04-2010, 11:29 AM
Tom (anyone)

I'd like to be able to separate this data so I can measure the divergence in moving averages in relation to price action. Below is the file I have to work with, is there anyway I can do this with out hand-jamming every single entry? As an example, this is 4 hour price data with the date and 7/28 SMAs for the Dow Transportation Index. This is not the entire file, the actual file would be pages long with hundreds of lines, so hand-jamming it would be too time consuming for me. Thanks

Date,Moving Average 7,Moving Average 28
12/28/2009 4:00:00 PM,4173.051,4133.529
12/29/2009 12:00:00 PM,4175.283,4137.482
12/29/2009 4:00:00 PM,4177.797,4142.233
12/30/2009 12:00:00 PM,4176.032,4146.964
12/30/2009 4:00:00 PM,4174.134,4151.142
12/31/2009 12:00:00 PM,4165.499,4153.294
12/31/2009 4:00:00 PM,4158.099,4154.248

tsptalk
12-04-2010, 12:47 PM
Under the Data tab in Excel, there is a function called "text to columns".

Copy your text into the spreadsheet and highlight it.
Go to "text to columns"
Click delimited (then "next")
Click on comma (then next).

And click finish

JTH
12-04-2010, 02:18 PM
Thanks Tom, you've helped open up a whole new world of research I can dig into, the wify ain't gonna be happy with you. :D

tsptalk
12-04-2010, 04:23 PM
Thanks Tom, you've helped open up a whole new world of research I can dig into, the wify ain't gonna be happy with you. :D
It's all in an effort to let "us" retire earlier. That's what I use. :)

PessOptimist
12-04-2010, 07:41 PM
Thanks for that also Tom. I never used that method.

FWIW, if the file you want to use is .PRN, .TXT or .CSV, you can open it with Excel. Choose text under file type. A window will open where you can drag the column lines. In the case of the example given, the first line may not be in the correct column but the data will be. YMMV.

This should eliminate the copy/paste step if there is a lot of data.

crws
12-04-2010, 08:14 PM
I'll be dang-nabbed! Never used that function!
Thanks Tom, and you too, PO, for the question.
More data for more indecision! :laugh: