Labels including a space
Posted: Thu Dec 03, 2020 9:52 am
Dear Tom,
I want to download financial market data from yahoo directly into RATS by using the URL as a file name. The file provided is in csv format. Unfortunately, one of the data labels in the first row contains a space "Adj Close". Thus, the data of the next column "Volume" is not recognized with the correct label in the data file. To make things worse, the part of the label string right of the space sign "Close" is identical with the name of another column.
If I use the left option in the Data instruction, i could read the Volume data, however, in this case RATS ignores the Date column and does not insert NA on days the market was closed due to a holiday. Is there a way to get the data for the volume column with the right dates?
I run into a second problem. I wanted to provide a selection for which column or combination of columns the data should be read into the workspace. I used several if instructions. However, if the first if is false, then no data will be read despite a later if clause is true. I expected that if one clause is false, that no instruction before the next end if would be executed. What is going wrong?
Best regards
PeterF
I want to download financial market data from yahoo directly into RATS by using the URL as a file name. The file provided is in csv format. Unfortunately, one of the data labels in the first row contains a space "Adj Close". Thus, the data of the next column "Volume" is not recognized with the correct label in the data file. To make things worse, the part of the label string right of the space sign "Close" is identical with the name of another column.
If I use the left option in the Data instruction, i could read the Volume data, however, in this case RATS ignores the Date column and does not insert NA on days the market was closed due to a holiday. Is there a way to get the data for the volume column with the right dates?
I run into a second problem. I wanted to provide a selection for which column or combination of columns the data should be read into the workspace. I used several if instructions. However, if the first if is false, then no data will be read despite a later if clause is true. I expected that if one clause is false, that no instruction before the next end if would be executed. What is going wrong?
Best regards
PeterF