Hello
I have over 100 pictures in my folder and I want import them all at once.
The pictures have following names: wavelength_001
For example.:
1510000_001
1510500_001
1511000_001
1511500_001
1512000_001
...
1630000_001
The last five numbers don’t change: 00_001
It would be nice if I can call every picture by its name.
Do you have a good idea how to do this? Maybe a While loop?
Best regards,
Peter
sghuisman
(Sander Huisman)
November 3, 2014, 2:45pm
2
Try something like:
SetDirectory[NotebookDirectory[]];
fns=FileName["*00_001*"]
imgs=Import/@fns
Save the notebook in the same folder as the pictures!
Thank you Sander for your answer. I tried it:
As you can see it does not really work. Have I done sth. wrong?
Peter
If I use
FindFile["1629500_001.tif"]
Mathematica finds the right path to this file. Therefore, I get there is sth. wrong with SetDirectory maybe???
Peter
sghuisman
(Sander Huisman)
November 3, 2014, 4:08pm
5
Sorry, I meant FileNames (notice the extra s)
Awesome, your solution is really nice. Thank you very much for your help!!! Also nice, that the solution is quite short and simple.
Cheers,
Peter
knazar
(Kashif Nazar)
March 5, 2015, 2:36pm
7
Hello sir ,
I saw your conversation and got much help thanks, but i am facing a similar problem, i want to fix an image in my codes. can you please help me do this. Here is my file in attachment.
Thanks