This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Any way to delete all NON LM objects?
#4
Code:
data = io.readfile('/home/ftp/data.esf')

if data then
  lines = data:split('\n')

  for _, line in ipairs(lines) do
    props = line:split('\t')

    if #props >= 5 then
      addr = props[1]:match('[0-9]+/[0-9]+/[0-9]+$')

      if addr then
        name = props[2]:trim()
        id = buslib.encodega(addr)
        db:update('objects', { name = name }, { id = id })
      end
    end
  end

  os.remove('/home/ftp/data.esf')
end
Is there any way to use this code with .json files instead of .esf? The reason is that .esf does not export knx objects which are not linked to anything and in addition it does not support some symbols from my language so instead of normal symbol it puts "?" in that place.
Reply


Messages In This Thread
RE: Any way to delete all NON LM objects? - by MantasJ - 18.11.2018, 22:40

Forum Jump: