{"id":2671,"date":"2021-10-28T14:47:52","date_gmt":"2021-10-28T14:47:52","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=2671"},"modified":"2021-10-28T14:48:09","modified_gmt":"2021-10-28T14:48:09","slug":"delete-last-line-in-txt-file-using-batch","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/delete-last-line-in-txt-file-using-batch\/27479.html","title":{"rendered":"Delete Last Line In Txt File Using Batch?"},"content":{"rendered":"<p>I actually have 2 questions.<br \/>\n1: I need to delete the LAST line in a txt file! NOT the first line!! How do i do this?<br \/>\n2: I need to read the entire file and set each line to a variable (line1,line2,line3,line4,line5&#8230;..) I was gonna use a var called var for the number ex.<br \/>\nset line%var%=&lt;Insert text here&gt;<br \/>\nset \/a var+=1<br \/>\n3: I also want it to goto something then return to the code. Like read one line then set the var then goto some_place then do some stuff then go back to the code to read yet another line.<br \/>\n4: It ALSO needs to stop once the entire txt file is read.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":8},"question-category":[55],"question_tags":[],"class_list":["post-2671","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/2671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=2671"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=2671"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=2671"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=2671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}