lua-users home
lua-l archive

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


2011/12/29 chuck@allthehowards.com <chuck@allthehowards.com>:

>
> here is my program - how do I open and print to 3 files, this does not work.
>

MACfile=io.open ("MAC.dat" , w)
IP1file=io.open ("IP1.dat" , w)
IP2file=io.open ("IP2.dat" , w)
>
> for s in io.lines("2011_12_02_sfccnetword20.txt") do
>
     for a in s:gmatch("DHCP.-to MAC address (.-),") do
MACfile:write("MAC",a) end
     for a in s:gmatch("DoS.-from ip.%[(.-)%]") do IP1file:write("IP1",a) end
     for a in s:gmatch("LAN.-%] from (.-):.- to") do IP2file:write("IP2",a) end
> end