Skip to content

Instantly share code, notes, and snippets.

@d-led
Created October 4, 2012 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d-led/3832285 to your computer and use it in GitHub Desktop.
Save d-led/3832285 to your computer and use it in GitHub Desktop.
filter vcproj files into a lua table
require('pugilua')
local doc=pugi.xml_document()
local res=doc:load_file [[..\pugilua.vcproj]]
print('Parsed: '..res.description)
assert(res.valid)
local text='{\n'
local query1=doc:root():select_nodes('/VisualStudioProject/Files/Filter/File | /VisualStudioProject/Files/File')
local n=query1.size
for i=0,n-1 do
text=text..'\t\''..query1:get(i):node():attribute('RelativePath').value..'\''..'\n'
end
text=text..'}'
print(text)
--local f = assert(io.open("dump.txt", "w"))
--f:write(text)
--f:close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment