문제

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?

올바른 솔루션이 없습니다

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top