Деян обнови решението на 29.10.2015 23:51 (преди над 2 години)
+package main
+
+func ExtractColumn(logContents string, column uint8) string {
+        var answer = ""
+        var from = 0
+        var count = 0
+
+        if column == 0 {
+                for index := 0; index < len(logContents); index++ {
+                        if logContents[index] == ' ' {
+                                count++
+                        }
+
+                        if count == 2 {
+                                answer += logContents[from:index] + "\n"
+                                count++
+                        }
+
+                        if logContents[index] == '\n' {
+                                from = index + 1
+                                count = 0
+                        }
+                }
+        } else if column == 1 {
+                for index := 0; index < len(logContents); index++ {
+                        if logContents[index] == ' ' {
+                                count++
+                        }
+
+                        if count == 2 {
+                                from = index + 1
+                                count++
+                        }
+
+                        if count == 4 {
+                                answer += logContents[from:index] + "\n"
+                                count++
+                        }
+
+                        if logContents[index] == '\n' {
+                                count = 0
+                        }
+                }
+        } else {
+                for index := 0; index < len(logContents); index++ {
+                        if logContents[index] == ' ' {
+                                count++
+                        }
+
+                        if count == 3 {
+                                from = index + 1
+                                count++
+                        }
+
+                        if logContents[index] == '\n' || index == len(logContents)-1 {
+                                answer += logContents[from : index+1]
+
+                                if logContents[index] != '\n' {
+                                        answer += "\n"
+                                }
+                                count = 0
+                        }
+                }
+        }
+
+        return answer
+}
Сигурен ли си, че искаш да обхождаш редовете байт по байт? Не забравяй, че низовете в Go са utf8. Може би има по - правилен начин да ги обхождаш?
