I am trying to create a program that will create a new text file for each iteration of a number ie passing in a parameter 3 and setting num=3 should create text.txt and the end result should have text3.txt, text2.txt, and text1.txt. I know that I need to use the touch command to create a new file, but I am unable to figure out how to change that specific variable when I create it.
-
Similar questions have been answered countless times here on SO. For example: stackoverflow.com/questions/13638670/…StFS– StFS2017-10-31 23:44:05 +00:00Commented Oct 31, 2017 at 23:44
-
Note that you don't want the accepted answer on the dupe (which is only good with constant values) but the runner-up.Charles Duffy– Charles Duffy2017-10-31 23:47:26 +00:00Commented Oct 31, 2017 at 23:47
-
Thank you so much!Charlie Yeng– Charlie Yeng2017-10-31 23:53:23 +00:00Commented Oct 31, 2017 at 23:53
Add a comment
|