Search in txt file, result in grid

Aquí puedes preguntar o compartir tus dudas y conocimientos acerca del programa
Search in .txt file, result in grid

Pls if any example...
10x

:google:

You should give more details ... what txt and keep data?, Are organized by columns grid? , More info ...

Ok i give you more details:
Example:
1. CSV (,) file with the following information: Name, Phone, Age
2.Input box search $ (Name or Phone or Age, or part of $) from CSV
2.Result in GRID:
If we search a phone number, result is entire line (from CSV) which phone belongs as an attribute (element)

10x in advance for help

Source:
function DelimitedToTable(s, d)
        if not d or #d < 1 then return nil end
        local tbl = {};
        local sa = s;
        local sD = "";
        local nP = string.find(sa, d, 1, true)
        while nP do
                sD = string.sub(sa, 1, nP-1)
                table.insert(tbl, #tbl+1, sD)
                sa = string.sub(sa, nP+1, -1)
                nP = string.find(sa, d, 1, true)
        end
        if sa ~= "" then table.insert(tbl, #tbl+1, sa) end
        return tbl;
end

tb = TextFile.ReadToTable("test.csv");
pattern = Input.GetText("Input1");



if tb then

	for i , v in pairs(tb)do
	found=false;	
		t=DelimitedToTable(v, ",")
			for n , k in pairs(t)do
				if(String.Find(k,pattern, 1, false)~= -1)then
					found=true
				end
			end
			if found then
			nrow = Grid.InsertRow("Grid1", -1, true);
			Grid.SetColumnCount("Grid1", #t+1);
				for n , k in pairs(t)do
					Grid.SetCellText("Grid1", nrow, n, k, true);
				end
			end
	
		
	end
end
Example:

https://dl.dropboxusercontent.com/u/270 ... nd_csv.apz

10x, Working like Google engine...
One parasite(redundant) column left in GRID after search (blank) but I try to fix - it ;)
Rafax you are the man :)
:yeah: