Click here to Skip to main content
15,559,819 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello everyone,
I am having trouble and was hoping for some help please.
I work for a GIS company in the UK and am currently working on a Mobile Mapping project. The camera in the car captures images every 3 metres and when processed each road is put into seperate folders. So for some days capture there could be more than 50 folders to go through 

My job is to go into each folder and filter by jpg to show all the images and then select all and copy image file path. This will leave me with an excel worksheet filed with the thousands of jpg image file path names.
I was really hoping there is a way that would enable me to select the image file paths without having to go through each folder.

Any help on this matter would be VERY much appreciated!


What I have tried:

I am not the best at coding so dont know where to start.
Posted
Updated 5-May-21 7:18am

1 solution

Not in SQL, no ... I suspect you picked the wrong language tag!

It's certainly possible, but exactly how would depend on the language / framework you are using.

For example, in C#, it's one line of code:
C#
string[] paths = Directory.GetFiles(rootPath, "*.jpg", SearchOption.AllDirectories);
The array then contains each JPG file complete with it's full path as separate strings.

In other languages it may be more complex, but it depends on your skill set, which we have no idea about!
 
Share this answer
 
Comments
Member 15185126 5-May-21 12:31pm    
Thank you for your comment. As you can tell I know very little about code! Would this code work if i tried it in CMD? Or can this be done in excel? Can I take out 'AllDirectories' and then insert the folder name I want?
OriginalGriff 5-May-21 14:30pm    
No; Not like that; No - it says "the rootPath folder and all it's subdirectories" so you would set the rootPath variable to the "start folder" that you store all the subdirectories in.

Which is probably all "Wha? Urk ... me no understand" to you, because this is a site for development and we tend to assume you have some programming experience (except for students, who mostly couldn't find the hole in a doughnut let alone learn anything) - so ask a question here, you get a "code based" answer, which is probably of no use to you at all! :laugh:

So I'll give you this instead, which may be what you are looking for:
How to list all file names from a folder and sub-folders into a worksheet?[^]

Probably more use to you than anything development related will be!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900