skinnyking 0 Posted July 28, 2016 Report Share Posted July 28, 2016 Hi guys How can I remove a single line from a text file? I can create the list etc and remove from the list but I'd like to remove a line from a text file also. Thanks! Quote Link to post Share on other sites
deliter 203 Posted July 28, 2016 Report Share Posted July 28, 2016 Their is a free plugin that you can break down a file into lines why not just as you are doing it ui open file("File",#file) define removeLine(#path, #Line Number To Remove) { comment("remember Lines Start from 1 not zero") add list to list(%lines,$list from text($read file(#path),$new line),"Don\'t Delete","Local") remove from list(%lines,$subtract(#Line Number To Remove,1)) save to file(#path,%lines) } removeLine(#file, 1) Quote Link to post Share on other sites
skinnyking 0 Posted July 28, 2016 Author Report Share Posted July 28, 2016 Perfect! Thanks very much Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.