example_01.bmx 504 B

1234567891011121314151617181920212223242526
  1. SuperStrict
  2. Framework Text.Csv
  3. Import BRL.Standardio
  4. Local stream:TStream = ReadStream("data.csv")
  5. Local csv:TCsvParser = TCsvParser.Parse(stream)
  6. Local count:Int
  7. Local total:Int
  8. While csv.NextRow() = ECsvStatus.row
  9. Local row:TCsvRow = csv.GetRow()
  10. Local col:SCsvColumn = row.GetColumn("Country")
  11. If col.GetValue() = "gb" Then
  12. count :+ 1
  13. col = row.GetColumn(4)
  14. total :+ Int(col.GetValue())
  15. End If
  16. Wend
  17. csv.Free()
  18. stream.Close()
  19. Print "gb rows = " + count
  20. Print "population = " + total