Running multiple for each file in Folder

I have two different folders with JPGs in them and im using another software(ExifTool) to pass the details of the pictures in the first folder to the second folder, for this i am using two for each file in folder and then using a type into activitie on the command line to the transition of details but since i am using a for each inside a for each the first folder keeps repeating the first JPG while the second one works properly. If anyone knows how to help i would appreciate it.

Thanks in Advance.
Pedro.

@pedro1

Welcome to the community

why are you using two for each?

why not one?

cheers

Hi Anil because i need to take the full file name from two seperate folders at the same time

Hi,

If possible please share input & expected output.

Thanks

Hello Jayesh. This is the Input that The Ui Path Types into the CMD, my problem is that the I need a way to run through both folders at the same time so the paths to the respective images get updated at the same time

perl exiftool -TagsFromFile ““Path\to\JPG\image.jpg”” ““Path\to\JPG\image2.jpg””. This goes into the CMD. The process first types into "perl exiftool -TagsFromFile " the the path of the first image and then the second image.

The output in the CMD is Image Updated Successfully.

Hope this helped.

Pedro

Try using break inside the 2nd For each after processing one file.

i tried that but that doesnt work because the second for each just went back to the first item

Ah! Got it… In that case use the Index value of the first For each in the second for each. Write a simple if condition saying if FirstIdex = SecondIndex then only proceed further!

im sorry but how would that work if i need the first for each index to get the path of one folder and the second index to get the path of the second folder, how would giving them the same index(same folder) solve my problem?