kamarád právě dodělává bakalářku a pracuje na jedné aplikaci ve Visual Basicu. Není to žádný programátor, a proto by vás rád poprosil o co nejjednoduší řešení. jelikož není česky mluvící, píšu sem já
tohle je jeho issue (kdyžtak pošlu odkaz na originální link) .... předem moc díky za jakoukoliv radu a pěkný den
_________
Alright,
I have a sequential file where the first value (string) indicates a month & year, second string is a location and the last value (integer) is distance.
Hide Copy Code
“12-2014” , ”Location A” , 10
“12-2014” , ”Location A” , 10
“3-2015” , ”Location B” , 20
“5-2015” , “Location A”, 10
I wish to read the file line by line and, depending on the month & year I select via combobox, get a sum of distance travelled for that month. So if I would select “12-2014”, I would get a DistanceSum of 20.
Secondly, I would like to select a location and a month and get a number of occurrences for that location in that month.
So for the sample above, a Location A in 12-2012 would give a value 2.
This should happen on a _Click. How should I proceed?
Thank you for taking your time to check this. I'm quite desperate after two days of going nowhere ... Sigh |
Hide Copy Code
Dim lines = IO.File.ReadAllLines(Application.StartupPath & "\dokumentiranje.txt")
Dim q = From line In lines _
Select cols = line.Split(","c)
Select New Entry With {.MonthYear = String.Parse(cols(0)), .Distance = Integer.Parse(cols(2))}
Dim DistanceSum = From item In q
?
For Each item In VsotaZaMesec
?
