DListView + file.Read

I added a kill log now. But I got a problem here.

init.lua
[lua]
function playerDies( victim, inflictor, attacker )
if attacker == victim then
filex.Append(“DPMod/logs/log.txt”, attacker:Name() … " suicided" … "
“)
else
filex.Append(“DPMod/logs/log.txt”, attacker:Name()…” killed "…victim:Name()… "
")
end
end
hook.Add( “PlayerDeath”, “playerDeathTest”, playerDies )
[/lua]

Now I’m running file.Read in a DListView:
[lua]
local DPModDListView6 = vgui.Create(“DListView”)
DPModDListView6:SetParent(Kill)
DPModDListView6:SetPos(3, 5)
DPModDListView6:SetSize(343, 400)
DPModDListView6:SetMultiSelect(false)
DPModDListView6:AddColumn(“Attacker, Victim & Weapon”)
DPModDListView6:AddLine( file.Read(“DPMod/logs/log.txt”) )
[/lua]

But it show’s up like this:
http://img228.imageshack.us/img228/8458/40128526.png

How can I get the text, that gets written by file.write to each line of the DListView?

[lua]for _,line in pairs(string.Explode("
",file.Read(“DPMod/logs/log.txt”))) do
DPModDListView6:AddLine(line);
end[/lua]

Read the file, and use the string.Explode function to break it up into a table of strings based on the newline.

Thanks.

[editline]11th January 2011[/editline]

The code worked.