0
$\begingroup$

I used the following code to import a large number of tiff images into notebook.

  SetDirectory[
  "C:\\My Files\\Shriram\\Paul 45deg 50%life 4x scan manual cs5.5 \
Tiff files"];
imagehl = FileNames["*.tiff"];
countgl = 1
 Do[imhl[countgl++] = Import[A0001], {A0001, imagehl}]    

From the above code I got image variables with the names imhl[1], imhl[2] ect till imhl[968] After this I performed some image processing on the files and saved them as imhl1[1], imh1l[2] ect till imhl1[968] Now I want to export all these images into a folder with similar names such as img1, img2 etc.. I tried using the following code but it does not seem to be working.

SetDirectory["C:\\My Files\\Shriram\\20x thick woven\\code\\export"];
counlt3 = 1;
counlt4 = 1;
Do[Export["img[" <> [counlt4++] <> "].jpg", imhl[counlt3++]], 968]

I am very new to Mathematica. Please help. Thank you.

$\endgroup$
  • 1
    $\begingroup$ you need to use ToString[counlt4] $\endgroup$ – george2079 Jun 26 '17 at 18:48
  • $\begingroup$ Hello. Could you please explain further? I am not sure how to use the ToString in my arrays $\endgroup$ – Shriram Bobbili Jun 29 '17 at 17:28
  • $\begingroup$ where you have [countl4++] it is a syntax error, you need ToString[countl4++] $\endgroup$ – george2079 Jul 3 '17 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.