Hi, I am a newbie to lua. I am saving files after analysis. I want to create a code to do following steps:
Step 1) search in a folder if there is a file with “filename = name*.dat” exists. (Here ‘*’ represents whatever the extension is. I use this in Matlab). Not sure how to do this in lua. I want to check for all files name_1.dat, name_2.dat…name_n.dat.
Step2) If any files with "name*.dat) exists, find the number of such files
Step3) then define variable n = number of such files
Step4) n=n+1
Step5) new_file_name = name_n.dat
How to make a Lua code for this?