10/01/14 03:51:17
>>238
Luaで
f=io.open("test.txt","r")
t={}
line = f:read()
while line do
tmp={}
for s in string.gmatch(line,"[%w]+") do
table.insert(tmp,s);
end
table.insert(t,{["氏名"]=tmp[1],["年齢"]=tmp[2],["性別"]=tmp[3]});
line = f:read()
end
f:close()
for i=1,#t do
print(t[i]["氏名"].." "..t[i]["年齢"].." "..t[i]["性別"])
end