I hope I am not posting in the wrong thread but I need help formatting some 3rd party data for TS
I would like to exclude the last 2 lines in this data sample . I am aware that the instructions has to be written in the attributes folder and that ( ,, ) needs to be written on the header line, but I am not sure how to do it correctly. Below in my sample data you will see there are 9 columns of data, representing
date open high Low close, volume open interest, I would like to exclude the last 2 columns
I can delete them using Excel, but I wanted to know if there was a easier way using either the attribute folder, or including some instructions in the header line within the data
date open high Low close, volume open interest
19950103,821.75000000,822 .50000000,820.75000000,82 2.00000000, 48984, 211544,199503,461.45000000
If you want to exclude those last two columns from every line, then awk (AWK - Wikipedia, the free encyclopedia) is the best command line tool to do the job. There are versions for windows that will work.
“Strategy without tactics is the slowest route to victory. Tactics without strategy is the noise before defeat.” - Sun Tzu
The following user says Thank You to cbritton for this post:
I just reviewed the details on the website, but since I am not a programmer, I will not be able to follow those instructions. I am sure that there must be a easier way to accomplish this task. The instructions in the Tradestation manual reads.
"Consecutive delimiters allow fields to be omitted from individual lines of data. In other words, if a header reads: 'Symbol', 'Category','Exchange','Description','PriceScale', you would have a data line that looks like this: MSFT, Stock, Nasdaq ,, 1/100. This would allow you to omit the entry for the Description. This can be done for any field or for multiple fields."
So it appears that a double comma (,,) has to be included, but I am not exactly sure how to do this, I have been experimenting but it has not worked yet so far
Here are links to the guidelines for using ASCII data in Tradestation. If you have a lot of data files, you can put the header row in a "parameter file" to be used by all the data files. This would eliminate the need to add a header row to each data file. But I have never tried this approach.
Thanks a million times, you are the absolute BEST, you are an absolute Genius, I will implement your idea and yes I have a lot of data files 10 years for each commodity. I dont quite understand what you meant by placing this information in a header instead of placing it in each commodity file, but I will start by trying it with one data folder first, hopefully it will also remove those extra zeroes or perhaps it does not matter