{"id":13623,"date":"2021-12-13T13:12:34","date_gmt":"2021-12-13T13:12:34","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=13623"},"modified":"2021-12-13T13:13:16","modified_gmt":"2021-12-13T13:13:16","slug":"delete-last-empty-line-of-text-file","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/delete-last-empty-line-of-text-file\/28424.html","title":{"rendered":"Delete Last Empty Line Of Text File"},"content":{"rendered":"<p>Hi,<br \/>\nI have text file with 1 or 2 empty line on the last. I need a batch script to delete the last (1 or 2) empty line<br \/>\nfor example :<br \/>\ntiger<br \/>\ndog<br \/>\ncat<br \/>\nmouse<br \/>\nempty line<br \/>\nempty line<\/p>\n<p>After run the script, it should be<br \/>\ntiger<br \/>\ndog<br \/>\ncat<br \/>\nmouse<br \/>\nthe last empty line will be removed.<br \/>\nPlease advice. Thanks a lot<br \/>\nAlex.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":22},"question-category":[47],"question_tags":[],"class_list":["post-13623","question","type-question","status-publish","hentry","question-category-hardware"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/13623","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=13623"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=13623"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=13623"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=13623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}