Hey guys,
I'm trying to create a downloader for wikifolio.com, german social trading platform.
Link to the CSV is:
https://www.wikifolio.com/dynamic/de/de/invest/download?type=daily&name=SG1979&dateFrom=31.12.2002&dateTo=20.10.2016
Sample is:
W F 0 0 Q U I N T E
Q u a l i t � t , a n g e l e h n t a n S u s a n L e v e r m a n n
A l l p r i c e s i n E U R
B e g i n d a t e ; T i m e i n t e r v a l ( m i n ) ; O p e n ; C l o s e ; H i g h ; L o w
1 1 . 0 9 . 2 0 1 6 0 0 : 0 0 : 0 0 ; 1 . 4 4 0 ; 2 8 3 , 9 4 6 ; 2 8 3 , 8 1 0 ; 2 8 3 , 9 5 1 ; 2 8 3 , 8 1 0
1 2 . 0 9 . 2 0 1 6 0 0 : 0 0 : 0 0 ; 1 . 4 4 0 ; 2 8 2 , 6 0 7 ; 2 8 3 , 8 7 1 ; 2 8 4 , 4 5 3 ; 2 8 2 , 0 0 0
I can get most of the problems solved, but one I cant: I seem they put a NUL-character after each character (Notepad++ shows them). Already tried to delete them with the pre-script, but seems like it does not work.
My Pre-script is:
for(int i = 0; i < Content.Rows.Length; i++)
{
You need to ignore all the rows: (loop through each row)
Content.Rows[i].IsIgnoreLine = true;
Get the content, remove the null character then parse the data:
string ct = Content.GetContent();
ct = ct.Replace("\0", "");
string[] rows = ct.Split('
');
....
After that, insert rows dynamically using "Content.AddRow" function
for(int i = 0; i < Content.Rows.Length; i++)
{
Content.Rows[i].IsIgnoreLine = true;
}
string ct = Content.GetContent();
ct = ct.Replace(" ", ";"); //Change "Space" between date and time to semicolon
ct = ct.Replace("\0", ""); //Remove NULL-chars, "backslash-zero"
ct = ct.Replace("\r", ""); //Remove CR-chars, "backslash-r"
ct = ct.Replace(".", "-"); //Fix date format to QS-readable
ct = ct.Replace(",", "."); //Change decimal comma to point
string[] rows = ct.Split('
'); //Split into rows, "backslash-n"
StreamWriter myStreamWriter = new StreamWriter(File.OpenWrite(@"C:\temp\myTestResult.csv"));
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.