hiteksoftware.com Forum Index hiteksoftware.com
User discussion forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Regex confusion

 
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Frequently Asked Questions
View previous topic :: View next topic  
Author Message
rgarrison



Joined: 06 May 2010
Posts: 2

PostPosted: Thu May 06, 2010 8:54 am    Post subject: Regex confusion Reply with quote

I am new to this and not the best at expressions. I am trying to setup a task that will move all files that start with

abc and ends with .txt

so the files are like abc_all-different-names.txt

But some of them have .cvs or .doc and I do not want then so selecting just .txt or just abc* will not work I need both rules only the files that start with abc and only the files that have the extension of .txt

Is this possible?
Back to top
View user's profile Send private message
melvin
Site Admin


Joined: 25 May 2006
Posts: 635
Location: Santa Barbara, california

PostPosted: Thu May 06, 2010 10:18 am    Post subject: Reply with quote

For the filename field use:
REGEXF=abc[.]{1,}txt

[.] matches any character
{1,} matches 1 or more of preceeding..
so [.]{1,} matches one or more of any character
Back to top
View user's profile Send private message Send e-mail
rgarrison



Joined: 06 May 2010
Posts: 2

PostPosted: Thu May 06, 2010 10:53 am    Post subject: Reply with quote

Thank you for responding but the files did not move and it says the following:
Total number of files in folders meeting folder name criteria = 311
May 6, 2010 1:48:14 PM
Total number of files meeting filename criteria = 0
May 6, 2010 1:48:14 PM
Total number of files meeting filename criteria and date modified criteria = 0
May 6, 2010 1:48:14 PM
Total number of files meeting filename criteria, date modified criteria, and new modified files criteria = 0

But here is a real name of a file there: abc_performance_analytics_patient_details_ch.txt
Back to top
View user's profile Send private message
bamos



Joined: 28 May 2010
Posts: 3

PostPosted: Fri May 28, 2010 6:20 am    Post subject: Reply with quote

I'm also new at these types of expressions and I'm trying to do something similar. I'm coming at it from a Windows admin angle. I need to transfer any pdf files that start with 88. For example:

883765897.pdf

I was working to transfer existing jobs from another app that we used into Automize and basically copied the old settings over. The old app was Windows only and used 88*.pdf. That seemed to work properly in Automize until we found that it was transferring any file that had 88 in the filename anywhere. So, if I ran it that way, 883765897.pdf and 478899345.pdf would both be transferred.

I tried the 88[.]{1,}pdf format as shown above, and got the same results as the original requestor... nothing transferred. I then tried it as 88.{1,}pdf , but both transferred.

Any way to specify that 88 must be at the beginning of the file name?
Back to top
View user's profile Send private message
melvin
Site Admin


Joined: 25 May 2006
Posts: 635
Location: Santa Barbara, california

PostPosted: Wed Jun 02, 2010 8:42 am    Post subject: Reply with quote

\A88 should match start of string.
if java regex does not support it then try:
^88
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Frequently Asked Questions All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group