Am 2013-08-14 um 21:00 schrieb Hans Hagen
for ts in io.lines(string.gsub(name, '%.pdf$', '-systems.count')) do syco = ts*1 end
well, you probably were lucky before: string.gsub returns multiple values so io.lines get a second argument that limits the length of what gets returned
Thank you, didn't know that!
local myfile = "myfile.txt"
for myline in io.lines(myfile,2) do logs.report("test",myline) end
so you need:
io.lines((string.gsub(name, '%.pdf$', '-systems.count')))
or
local name = string.gsub(name, '%.pdf$', '-systems.count')
io.lines(name)
Great, that works!
or maybe better:
io.lines(file.replacesuffix(name,'-systems.count'))
No, that doesn't work, because the dot stays, so I get foobar.-systems.count Greetlings, Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)