I need a script to go in and grep following inside of a file (text): ### SOME CONTENT SNIP local url_check = { GET LINES BELOW --- ["/images/one.jpg"] = true, -- timestamphere ["/images/foo.jpg"] = true, -- timestamphere ["/images/baz.jpg"] = true, -- timestamphere --- GET LINES ABOVE } SOME CONTENT SNIP ## Explode those lines to $line, $timestamp (very easy), save to array then when I need it script should go back to file and replace content with new lines in exacly same spot, overwriting old.