%	BatchHaraldMovie.m


%   This software is protected by german copyright and international treaties.             
%   Copyright 2004 Markus Junghöfer & Peter Peyk. All Rights Reserved.                     
%                                                                                          
%   THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE        
%   NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO,    
%   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE    
%   OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
%   TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT,       
%   INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE      
%   OR DOCUMENTATION.    

clear all;

%***************** TeilI: Batch-file******************************
%**************Read files names****************
fid=0;
		[FileTmp,PathTmp]=uigetfile('*.*','Open batch file: ',0,0);
			FilePathTmp=[PathTmp,FileTmp];
			[fid] = fopen(FilePathTmp, 'r');
			NFiles=0;
		while feof(fid) == 0;
		NFiles=NFiles+1;
%********************************************************
%****  first file     ********************
		line=fgetl(fid);
		RawFilePath=line;
			if NFiles==1
				RAWFileMat=char(RawFilePath);
			else
				RAWFileMat=char(RAWFileMat,RawFilePath);
			end
%********************************************************
		end		
		status = fclose(fid);
		RAWFileMat
		[NNetFiles,N]=size(RAWFileMat);
%********************************************************
%*************** Ende TeilI: Batch-file*************************
%********************************************************

for j=1:NNetFiles
	File1=RAWFileMat(j,:);
	File2=strrep(File1,'-I-','-II-');
	File3=strrep(File1,'-I-','-III-');
	OutFilePath=strrep(File1,'-I-','')
	InFileMat=[];
	InFileMat=char(File1);
	InFileMat=char(InFileMat,File2);
	InFileMat=char(InFileMat,File3)

	[OutFilePath]=MergeEgisFiles(InFileMat,OutFilePath)	
	
	
end

return
