Hello mates, I am trying to reorganize data from a .txt
file defining delimiters. Example of data:
password 0.0.3 13.99.102.201:5021133.20.130.214:50212
I am trying to split this data tracking blank spaces
and five bytes
after the :
symbol to save it into different variables. Exactly like shown below.
key = password
node = 0.0.3
address1 = 13.99.102.201
tls1 = 50211
address2 = 33.20.130.214
tls2 = 50212
Code:
content, err := ioutil.ReadFile(title)
if err != nil {
fmt.Println("Err")
}
data := strings.Split(string(content), ":")
Nevertheless strings.Split(string, ":")
actually delete the delimiter instead of working as a starting point to crop the text.