Question

I need to make an array containing over 100 different image names and I wonder if there is any way to "convert" the image names from a folder into a .txt file using terminal to then paste them into xcode instead of manually write all of them. Any advice?

No correct solution

OTHER TIPS

You can go to terminal and type

ls                   # list files
ls -lt               # list files with details
ls *.jpg             # list only jpg files
ls > files.txt       # list files and write them to files.txt

The # by the way, is just a comment. You can combine the above commands.

Although I need to say, that the PROPER way of doing this, is letting you code find those files in the desired directory, unless there's a good reason for not doing so.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top