

InterviewSolution
Saved Bookmarks
1. |
Solve : auto increment for filename and file content? |
Answer» <html><body><p>how to append a new line into texts?<br/>i got full of codes at file1.txt<br/>test <a href="https://interviewquestions.tuteehub.com/tag/abcdefg-361051" style="font-weight:bold;" target="_blank" title="Click to know more about ABCDEFG">ABCDEFG</a> a1<br/>nmjkloi<br/>ddkkkoll<br/><br/>and i want to auto generate 1000 <a href="https://interviewquestions.tuteehub.com/tag/files-20889" style="font-weight:bold;" target="_blank" title="Click to know more about FILES">FILES</a>, the file name <a href="https://interviewquestions.tuteehub.com/tag/increase-238127" style="font-weight:bold;" target="_blank" title="Click to know more about INCREASE">INCREASE</a> by +1 and the number after a (a1) also increase by +1<br/>so i have<br/>file2.txt (a2)<br/>file3.txt (a3)<br/>....file1000.txt (a1000)<br/><br/><br/><a href="https://interviewquestions.tuteehub.com/tag/c-3540" style="font-weight:bold;" target="_blank" title="Click to know more about C">C</a>:\test>type only.bat<br/><br/> echo off<br/><br/>rem echo nmjkloi >> file1.txt<br/><br/><br/><br/>for /L %%i in (1,1,1000) do (<br/>echo %%i<br/>set ck=%%i<br/>echo hello >> file%%ia%%i.txt<br/><br/>rem if %ck%==10 goto :end<br/><br/>)<br/>:end<br/>type file*.txt<br/>rem echo nmjkloi >> file1.txt<br/><br/><br/>rem <a href="/cdn-cgi/l/email-protection">[email protected]</a><br/>C:\test>Cool new name, Bill.<br/></p></body></html> | |