{"id":13728,"date":"2021-12-13T14:51:40","date_gmt":"2021-12-13T14:51:40","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=13728"},"modified":"2021-12-13T14:52:28","modified_gmt":"2021-12-13T14:52:28","slug":"using-goto-command-inside-for-loop","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/using-goto-command-inside-for-loop\/21381.html","title":{"rendered":"Using Goto Command Inside For Loop"},"content":{"rendered":"<p>hi..<br \/>\ni am trying to create a batch file which will copy the first line of a file from a list of file to a temporary file with an extra field. but when i am using a goto command inside a for loop its giving error.<\/p>\n<p>the code is as below<br \/>\n@echo off<br \/>\nsetLocal EnableDelayedExpansion<br \/>\ndir \/b\/a-d c:\\my_folder &gt; c:\\rfile.txt<\/p>\n<p>for \/f %%i in (c:\\rfile.txt) do (<br \/>\nfor \/f &#8220;delims=$&#8221; %%j in (c:\\my_folder\\%%i) do (<br \/>\necho %%j,filename &gt;&gt; c:\\my_folder\\temp_%%i<br \/>\ngoto fin<br \/>\n)<br \/>\n:fin<br \/>\n)<\/p>\n<p>can anybody tell me how to do this??<\/p>\n<p>thanks in advance<br \/>\nroy<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":10},"question-category":[55],"question_tags":[],"class_list":["post-13728","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\/13728","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=13728"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=13728"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=13728"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=13728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}