Hello
RE: Reading line by line a csv file:
I'm gathering information before I start to code this weekend. I want to read line by line a csv file to get all my traded orders during the day. The goal is to show them using arrow on my charts. I don't trade via MC, so I don't have them in MC file.
I will read the file with Elcollection and save it as a string. I know how to read each column in a line using my function splitstring viewtopic.php?f=5&t=8950&p=42264#p42264
Now,
- How do i read individual line. Is there a code to look for for a new line?
- Is there a value to look for that indicate the end of the file?
- Is the Elcollection will be available in the 64 version?
Any info appreciate
Martin
Line reading in a CSV file
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Line reading in a CSV file
viewtopic.php?f=16&t=10094Hello
...
- Is the Elcollection will be available in the 64 version?
Any info appreciate
Martin
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Line reading in a CSV file
This is not needed, since the ELCollection reads the whole file with ListN.ReadFile() or ListS.ReadFile(). You will then need to use the ListX.Count(ID) function to get the length of the list, and then you can loop through it.I will read the file with Elcollection and save it as a string.
(..)
- How do i read individual line. Is there a code to look for for a new line?
In other words, you can't specify the line that needs to be read, but you first have to import the file, and then you can go to a specific line.
After you've loaded the list with ListN.ReadFile(), you can use ListX.Front(ID) for the first value or ListX.Back(ID) for the last value, or ListX.Get(ID, Index) to get a specific entry for a specified index number.- Is there a value to look for that indicate the end of the file?
Btw, this post has a function attached that, if I understand you correctly, can be very helpful for coding this (since it's practically the same).
Happy coding.