Lua pattern
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Lua pattern
- From: "ranier@..." <ranier@...>
- Date: 2012年12月18日 10:55:26 -0200
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