View difference between Paste ID: G9zgG5Hp and zFu02kw4
SHOW: | | - or go back to the newest paste.
1-
local tLines = {}
1+
curline = ""
2-
local nLine = 5 -- Say we don't want line 5.'
2+
3-
local file = fs.open( "jobs", "r" )
3+
file1 = fs.open("jobs", "r")
4-
local fileContents = file.readAll()
4+
file2 = fs.open("temp", "w")
5-
file.close()
5+
repeat
6
curline = file1.readLine()
7-
-- Compatibility: Lua-5.1
7+
if not curline == nill then
8-
function split(str, pat)
8+
if fs.exists(curline) then
9-
   local t = {}  -- NOTE: use {n = 0} in Lua-5.0
9+
file2.writeLine(curline)
10-
   local fpat = "(.-)" .. pat
10+
11-
   local last_end = 1
11+
12-
   local s, e, cap = str:find(fpat, 1)
12+
until curline == nill
13-
   while s do
13+
file1.close()
14-
          if s ~= 1 or cap ~= "" then
14+
file2.close()
15-
  table.insert(t,cap)
15+
shell.run("delete", "jobs")
16-
          end
16+
shell.run("copy", "temp", "jobs")