| 
		
			| Re: read several files at once [message #39783] | Sat, 12 June 2004 00:10 |  
			| 
				
				
					|  R.Bauer Messages: 1424
 Registered: November 1998
 | Senior Member |  |  |  
	| Adhara wrote: 
 >  Hello, here is the advance that I made to convert a bitmap file into
 >  an image...However, I MUST DO IT SEVERAL TIMES!! How can I do that?
 >
 >  Best regards!
 >  Adhara
 >
 >
 >  file=Dialog_Pickfile(Title='Pick the folder',Filter='*.txt',$
 >                           Get_Path=data_dir)
 >  CD,data_dir
 >
 >  openr,lun,file,/GET_LUN
 >  scan=BYTARR(6,6)
 >  readu,lun,scan
 >  free_lun,lun
 >  tvscl,scan
 >
 >  result = DIALOG_WRITE_IMAGE(scan, FILENAME='001.tif')
 >  end
 
 
 Dear Adhara
 have a look at the dokumentation of Dialog_Pickfile. There is a
 multiple_files keyword
 
 Then you need a loop over the selected files.
 n=n_elements(file)
 for i=0,n-1 do begin
 openr,lun,file[i],/GET_LUN
 ....
 
 result = DIALOG_WRITE_IMAGE(scan, FILENAME=file[i]+'.tif')
 endfor
 
 If you like to have it more in batch process, You could do this by replacing
 Dialog_Pickfile with file_search.
 
 You should have a look on file_basename too.
 
 Reimar
 
 
 
 --
 Forschungszentrum Juelich
 email: R.Bauer@fz-juelich.de
 http://www.fz-juelich.de/icg/icg-i/
 ============================================================ ======
 a IDL library at ForschungsZentrum Juelich
 http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
 |  
	|  |  |