Skip to content

Instantly share code, notes, and snippets.

@d-led
Created October 4, 2012 08:41
Show Gist options
  • Save d-led/3832290 to your computer and use it in GitHub Desktop.
Save d-led/3832290 to your computer and use it in GitHub Desktop.
filter vcxproj files into a lua table
require('pugilua')
local doc=pugi.xml_document()
local res=doc:load_file [[..\pugilua.vcxproj]]
print('Parsed: '..res.description)
assert(res.valid)
local text='{\n'
local query1=doc:root():select_nodes('/Project/ItemGroup/ClCompile | /Project/ItemGroup/ClInclude')
local n=query1.size
for i=0,n-1 do
text=text..'\t\''..query1:get(i):node():attribute('Include').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