lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello All,
Sorry, I´m newbie in lua programming.

Anybody can help with pattern to process http://www.bcb.gov.br/rex/ftp/paises.txt
I would like split in two variables s1 and s2
s1 = 00132
s2 = AFEGANISTAO

----------------------------------------------------------------------------------
local pat = "(%S+)%s+(%S+)"

for s1, s2 in string.gmatch(io.read("*all"), pat) do
   print(s1, s2)
end
----------------------------------------------------------------------------------

Best regards,

Ranier Vilela