Given the following example:
def servers = "sftp.host.com:32025|GB,sftp.host.com:32029|ES,sftp.host.com:32030|PT,sftp.host.com:32027|FI,"
servers.split(',').each {
it.split("\\|").each {
println("sftp address: ${it[0]} countrycode: ${it[1]}\n")
}
}
The idea was to extract some fields from a delimited list of , then get address|countryCode out from that field to process further, but the only thing i am getting out is the first letter of each field.
sftp address: s countrycode: f sftp address: G countrycode: B ...
Not sure whats going on here?