Created
March 30, 2017 02:38
-
-
Save young40/04f340273c011fd173ba1e40b2469f5c to your computer and use it in GitHub Desktop.
replace tab with 4 space
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function tab2space(filename) | |
local lines = {} | |
io.input(filename) | |
for line in io.lines() do | |
table.insert(lines, line) | |
end | |
local newLine = {} | |
for _, line in ipairs(lines) do | |
line = string.gsub(line, "\t", " ") | |
-- print(line) | |
table.insert(newLine, line) | |
end | |
local allLine = table.concat(newLine, "\n") | |
local fp = io.open(filename, "w") | |
io.output(fp) | |
io.write(allLine) | |
io.close(fp) | |
end | |
tab2space("PlaySceneGA.lua") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if you'r using OS X, there is a command /usr/bin/tab2space