| Author | 
		  Message
		 | 
		
		  | chaitu | 
		  
		    
			  
				 Posted: Wed Nov 04, 2015 9:44 am    Post subject: Validating file name | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 15 Apr 2014 Posts: 89
  
  | 
		  
		    
			  
				Hi All,
 
 
My requirement is like to validate the file name with a file pattern like
 
 
REGEST_xxxxxx_DATE_FROM_TO_FYYMMDDHHMMSS.zip
 
example
 
9MAFE_AXM0101_240703_WMKK_ZPPP_F240702003432
 
 
i used the substring function and extract the values like reg...
 
now i am not understanding how to compare the in coming file name
 
 
suggestions please.
 
 
Regards. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Wed Nov 04, 2015 9:50 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				The incoming file name is in the logical message tree, in the part populated by the File Input node.
 
 
Comparisons are done in ESQL using the standard = comparison operator.
 
 
Your example doesn't match your pattern... ? 
 
"_DATE_FROM_TO_" is not equal to "_240703_WMKK_ZPPP_" ? _________________ chmod  -R ugo-wx / | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | chaitu | 
		  
		    
			  
				 Posted: Mon Nov 09, 2015 10:28 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 15 Apr 2014 Posts: 89
  
  | 
		  
		    
			  
				Hi All,
 
 
my flow is like 
 
filei/p>>compute>>fileo/p
 
 
i need to validate the file with naming convention given to the file and send it to fileo/p if it matches if it does'nt matches i need to through the exception.
 
 
can anyone please help me how to figure it out.
 
 
Regards. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Mon Nov 09, 2015 2:12 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				you'll need to look it up by verifying some pattern.. ie either you can do it with regular expression or you need to verify each item of the String against all possible values (DB lookup?)
 
Have fun   _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | chaitu | 
		  
		    
			  
				 Posted: Mon Nov 09, 2015 9:20 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 15 Apr 2014 Posts: 89
  
  | 
		  
		    
			  
				Hi All,
 
 
I need to do it with the pattern like
 
 
9MRTS_AXM0024_150707_VOTR_WMKK_F150707164015.zip
 
 
every file should come in same pattern but the values will change 
 
 
like
 
 
9RTSM_AXM0036_150808_WMHY_CFKK_F150808164015.zip
 
 
 
Any suggestions please. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | timber | 
		  
		    
			  
				 Posted: Tue Nov 10, 2015 3:52 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 25 Aug 2015 Posts: 1292
  
  | 
		  
		    
			  
				Use a Java method to validate the file name using a regular expression?
 
 
Please do not ask for help with that - all of the answers are available via Google or the Search button. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |