Posted 13 July 2016 - 12:41 AM
Okay, getting bored is apparently very unhealthy for me.
Anyway, what I'm trying to do is that I have a file with just random words, one per line.
And I want to quote every word and add a comma afterwards.
So far I have this code:
(Yes this is by far not enough)
Anyway, what I'm trying to do is that I have a file with just random words, one per line.
potato
carrot
tomato
--#And so on
And I want to quote every word and add a comma afterwards.
So far I have this code:
(Yes this is by far not enough)
function convert()
local file = fs.open("conversion.txt", "r");
local finalconversion = fs.open("converted.txt","w")
local arr = {}
for line in io.lines(file) do
finalconversion.writeLine(' "'..line..'", ')
print('"'..line..'", ')
end
file.close()
finalconversion.close()
end
convert()