I would like to turn the contents(filenames) of a folder into a .csv
My problem is that the files are organised in sets. I only want to output the filename of each set without anything else but the first numbers.
Example of files in folder:
I found some code that i modified with no luck. I assume i have to loop through the files and check for any non-digit characters and pars that somehow. Any help would be much appreciated.
set src to (choose folder with prompt "Choose source folder where source tree is rooted at")'s POSIX path set theCsv to "" repeat with i from 1 to number of items in src tell application "Finder" to set this_item to displayed name of item i of src set this_item to this_item & ",\\n" set theCsv to theCsv & this_item end repeat do shell script "echo " & quoted form of theCsv & " > ~/Desktop/names.csv"